Zork | Zork , a text adventure game , written in python | Game Engine library
kandi X-RAY | Zork Summary
kandi X-RAY | Zork Summary
Zork, a text adventure game, written in python.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Analyze command
- Analyse the description
- Build a character
Zork Key Features
Zork Examples and Code Snippets
Community Discussions
Trending Discussions on Zork
QUESTION
#The Commands are going North and South in the Y - variable and East and West in the X - variable and X - to exit the game
x = 0
y = 0
print("Welcome to sloth quest!")
print("________________________________________")
print()
print("You're currently at position (0, 0) in the world.")
print("Available commands:
N - go north, S - go south, E - go east, W - go west, X - exit game)
command = input("Enter a command: ")
if command == ("N"):
y = y + 1
elif command == ("E"):
x = x + 1
elif command == ("S"):
y = y -1
elif command == ("W"):
x = x -1
#I want to make a loop so that these commands can be input together so that the goal or hazard is reached.
...ANSWER
Answered 2022-Mar-06 at 21:55# The Commands are going North and South in the Y - variable and East and West in the X - variable and X - to exit the game
x = 0
y = 0
print("Welcome to sloth quest!")
print("________________________________________")
print()
print("You're currently at position (0, 0) in the world.")
print(
"Available commands: N - go north, S - go south, E - go east, W - go west, X - exit game")
while True: # run untill the user enters X
# limit play area to -5 x 5
command = input("Enter a command: ")
command = command.upper() # Ensure user input is upper case
if command == ("N"):
y = y + 1
elif command == ("E"):
x = x + 1
elif command == ("S"):
y = y - 1
elif command == ("W"):
x = x - 1
elif command == 'X': # Exit the loop
break
if x < -5 or x > 5 or y < -5 or y > 5:
# What should happen?
print("error you have left the play area")
print('Thanks for playing') # Exit the game.
# I want to make a loop so that these commands can be input together so that the goal or hazard is reached.
QUESTION
I want to complete the command with 2 different source files in one operation, is that possible?
my codes :
...ANSWER
Answered 2021-Mar-12 at 17:08Combined command:
QUESTION
I've been doing some experimentation in batch and I'm currently working on the beginnings of a small text adventure, but when I was testing a savegame, the program returned the error "The system cannot find the file specified." Can somebody help me out? (If its any help I'm on a school computer).
Here's the snippet of my code in question:
...ANSWER
Answered 2021-Jan-27 at 20:09I'm assuming that your intention will be to retrieve more than one value from your savegame.sav
file, so perhaps changing your methodology from the outset would serve you well.
The first advice I'd provide is to always, prefix your in game variables with the same character. (In the example below, I've chosen {
, and to improve the look, I've also suffixed them with }
, which is optional)
To make sure that variables prefixed with that character, and already existing in the local environment, do not interfere with our game variables, we first of all disable them.
Now we create three labelled sections for showing all variables with their values, saving all variables to a file, and loading all variables from that file.
We can then call
those labels as needed.
Here's a vary basic example to show them working:
QUESTION
I am a total noob when its about Kotlin, but I think it is fun to use and in my free time, I am trying to learn it. I got some books and went through them and based on that, to get more practical experiences, I am trying to create a little text-based adventure in the Kotlin JVM, like Zork. There should be different rooms and each room should have some items, that can be looked at and taken (later wanna implement that you can use them). My Problem is: The user should input "take {name of item in that room} in the console. But i am unable to reference the name of the item of the mutable list of the cellar. All internethelp only have some easy examples, so I couldnt find a solution to this. All i can let the console do is "room.name" so then he gives me the name of the room. But i dont want to get the name of the room, i want to get the name of the Item in that room. Can somebody please help me?
...ANSWER
Answered 2020-Dec-18 at 14:11You can use filter for this,
QUESTION
Apologies if this is a dumb question. I've done a bit of searching, and haven't been able to find the info I need though. I'm very new to python. Currently in the middle of the Learn Python 3 The Hard Way course.
I'm trying to write an IF statement that takes a user generated string, and compares it against a list, and then evaluates to True, if there is a match.
I have been able to do this successfully using:
...ANSWER
Answered 2020-Nov-05 at 01:23All you need to do is use a list []
square brackets, instead of curly ones (those are for sets) and you need to move the choice variable ahead. ( You want to see that the choice
is in the list, and not the other way around. )
Your code should be :
QUESTION
Im new to coding, and pretty confused by the concept of class 's and how to use them. Im making a zork game as a practice exercise and have the following as part of my code:
...ANSWER
Answered 2020-Jul-04 at 20:42Define a method in your class named hurt
and a getter for health
, like this :
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Zork
You can use Zork like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page