Give idea to do someting with python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Give idea to do someting with python

Hello guys, now i dont know what do :/.. Can someone give idea to my to do something for begginer? something Easy - Medium for me. I dont have ideas .. I read forums but there not find anything... Thanks all who give idea ^^ Waiting !

18th Nov 2016, 11:46 AM
Lukas Bolevičius
Lukas Bolevičius - avatar
23 Answers
+ 2
yes you will need a lot of inputs so that the player will type the choices he makes, and a lot of if's and elifs ( use else instead only to print out a message if the player types an invalid command ). But most importantly an infinite while loop, that will keep the game going. Then you will just have prints were you will write the text of the story.
18th Nov 2016, 7:13 PM
Anitei Leonard
Anitei Leonard - avatar
+ 1
write an interactive story, where choices you make will change the endings or something like that. That was one of the first codes I made with python
18th Nov 2016, 12:34 PM
Anitei Leonard
Anitei Leonard - avatar
+ 1
I meant a sort of game story, like heavy rain, where depending one what you choose the story will change. Nothing graphical of course, just text. to make a little example, the main character of the story is in a room with two doors, and depending on which door the player chooses to go, the story will be different ( if he chooses door 1 he will die because leads to a room full of giant spiders, door 2 will lead him to the exit , or something like that). Have fun coding :)
18th Nov 2016, 2:36 PM
Anitei Leonard
Anitei Leonard - avatar
+ 1
Thanks for answer. I will try :)
18th Nov 2016, 7:21 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
+ 1
No problem :). have fun. Looking forward to see the result
18th Nov 2016, 7:23 PM
Anitei Leonard
Anitei Leonard - avatar
+ 1
Nice work. There are still some things that you could fix, but overall is not bad. I really like the random ending feature that you make. Keep learning and coding :)
19th Nov 2016, 11:59 AM
Anitei Leonard
Anitei Leonard - avatar
+ 1
some codes that I created : Password generator Hangman game number finder (look in my codes) i m trying to create an algorithm inwhich the user inputs the coordinates of a point and the program outputs if yes or no the point is in or out of a random type of polygon good luck !
20th Nov 2016, 2:39 AM
pilou22[EP]
pilou22[EP] - avatar
+ 1
you made it with functions. That's good. Nice job
20th Nov 2016, 12:49 PM
Anitei Leonard
Anitei Leonard - avatar
0
Thanks for answer. U mean to do different storys when u press RUN and randomly chose a story and ending? I think its be diffulity for me :/ but i will try me best :) any other ideas?
18th Nov 2016, 1:49 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
Ohh understand now what u say. Can u say what i need use? (like input, if/else ect)?
18th Nov 2016, 3:26 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
I think game be more intersting with random count what be after open door :) now just think, how correctly use it :). I think i can do in some weeks xd
18th Nov 2016, 7:28 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
So i done code today, go check and say its good or not? (I try my best) :)
19th Nov 2016, 6:43 AM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
Thanks! It's good motivation for me. Soon i think do a little better game soon as i learn classes and other things:)
19th Nov 2016, 12:22 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
I have question. What do better? Do new text game or improve that door game code? i have some ideas with door game to improve it, but dont know how to do. E.g You open door, saw hmm Zombie and there is door. Randomly choose u sucess or die. But dont know how to use input second time to block first code and be without error. Have any ideas how to do this?
19th Nov 2016, 5:07 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
I don't fully undertand your question, but if you want to stop the code from going on and wait for the player input just put a variable set with an input (like you did before to choose the door ). The input command automatically stops the code and waits until the player types in something. Then based on what the played types you go on (e.g the player types fight the zombie, he dies, he types flee, he goes back to the starting point )
19th Nov 2016, 5:50 PM
Anitei Leonard
Anitei Leonard - avatar
0
hmm dont know how to say correct. Like first pass 1st doors(used input), when randomly choose what be after door open, when doors opened and be zombies like explame, when u see 2 doors and zombies walking around, when need use input to choose doors second time and it be success or die randomly if success u go trought door, pass zombies and other things be like exit or something like that, if not u die and need start new game. Me dont know how to use input 2nd to like u say stop code and wait till player choose 1st or second doors. I have idea when learn more do with fights ect improve code :) can u help me with that second time use input? Dont know how to do
19th Nov 2016, 6:01 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
well just put an input exactly how you did before where you want. Don't know how to explain it better . But when the interpreter reaches a line of code where there is an input command it automatically stops and waits for the player to type in the command. Solo Learn code playground doesn't do that...don't know why, but if you run your code directly on the computer it will act like I said before
19th Nov 2016, 6:12 PM
Anitei Leonard
Anitei Leonard - avatar
0
Oh i think understand what you say. But it be bad for me testing code if this not stop, so i can do it but cant test if it works correctly
19th Nov 2016, 6:49 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
Fixed code little saw where i do mistake
19th Nov 2016, 7:22 PM
Lukas Bolevičius
Lukas Bolevičius - avatar
0
Hi, thanks for answer. Later maybe now im working on open door game to improve it :)
19th Nov 2016, 8:38 PM
Lukas Bolevičius
Lukas Bolevičius - avatar