Home Project1 Project2 Project3

Text Adventure game Development:

Task 1

Development

description Code
I'm doing the intro,scenario1 and die of strvation. I started this function by using comments to plan it out. This will also make it easier to read later.
I asked the user's name first.Then let then random selection background. They can just give the computer a number.This number must bigger than 0,smaller than 1000.
Then they are going to make selection.

They have four selection.

a= "Yes,i want to"

b= "No,nononono"

c= "into the deeper forest/go walk front"

d= "get killed by the system

And the question is "Do you want to front/into the deeper forest? ?"

Then I have add some GOOD COMMENTS and BAD COMMENTS.
For the end. I asked them,“Do you want play this game again?”

Testing

Test/Input Expectation Output
Random selection background It is working,but it repeat the reminder condition.This makes the game a bit tedious.
Identify numbers and non-numbers When I enter non-number.The computer can't identify thst's a non-number. And still reply "the number should bigger than 0,smaller than 1000."and then reply again "that's not a number".

Even though I have satisfied the condition, for example I entered 7, the computer keeps repeating the condition and I cannot proceed to the next step.

Test whether the options evolve correctly When I selected option "d", the computer replied with the correct comments, but it seemed to reply with the same comments twice. This makes the game tedious.
Test whether the options evolve correctly This time, when I typed in the "d" option, the computer responded with" great, "or good comments. I think there's something wrong here.
Die and Replay If the user answered the question"yes",the computer gonna replay the "print",which is "just open this game again and replay"

Feedback

How do you feel about the way it personally greets the player?

I like it,it's very good.

Good,good job.

Do you think the function introduces the quiz well, or does there need to be more?

I can understand the game very game for this.

It's very useful to help us to understand it.

Improvements

description for the code and what did I Improve for the code Code
I have delete the "answer=input("We have a thousand backgrounds for you. Just give a number that you thinking now.The number must bigger than 0,smaller than 1000.")" before the While Ture. This makes the text/game more easy.
The problem for here is the code "Pass". In Python,In Python, the pass statement is a placeholder used when a statement is required syntactically but you do not want any code to be executed. It essentially does nothing and is often used as a temporary placeholder for code that you plan to write later or as a way to create minimal classes or functions during initial development. I think that's why the game can not get into next step.
And "Break" means the keyword is used to break out a loop, or a loop. So I swiched their places,then deleted the "pass" code. Also I added the "print("The number should bigger than 0,smaller than 1000")" after "if answer>1000 and answer smaller than 1. And after except,I only added "print("That's not a number")". It means if the user have enter something that not a number,the computer gonna reply this message.
For this part,the code I worte before is "if answer == "a"or"c".lower() or answer==a or c.lower():"

Now I changed it to "if answer == "a"or answer=="c".lower() or answer==a or answer==c.lower():"

"I added the answer== after answer=="a" or and answer==a or"

For here ,I relized that the "c".lower() is just a string "c" and doesn't compare it with answer. a and c are not defined variables, causing a NameError if this code is run. or maybe the computer can not recognize it when we enter option "c" for this question.

For this part,My Original code has no Technical error.

But in order to make our games "smart and convenient",I chnaged "print("just open this again and reply.") to "intro()"

Testing

Test/Input Expectation Output
Random selection background working for recognize number.
Random slection background working for recognize any bigger or smaller number and non-number.
"A" option working
"B" option working
"C" option working
"D" option working
Replay replay working

Feedback

Any final feedback, especially about the new changes?

I don't think there are any technical errors in my code, But next time I can try to make my code a little more complex and make the game a little more accurate and have more conditions.

Nonononono.I think my code is perfect!!!!!!!thank you very much!!!!!

Final Code