d2jsp Forums > Off-Topic > Programmer's Haven > Python Coding
Add Reply New Topic New Poll
Group: Member
Posts: 10,579
Joined: May 21 2006
Gold: 6.00
Feb 16 2023 08:43am
So i am currently doing a project where I have to create a text based game I am struggling on the loop for moving from room to room. Is there anyone out there that might be able to help me if I send the dictionary of rooms and direction?
Group: Member
Posts: 8,315
Joined: May 30 2008
Gold: 0.00
Feb 16 2023 10:03am
Group: Member
Posts: 21,885
Joined: Aug 9 2018
Gold: 336,935.00
Feb 17 2023 07:46pm
is great
Group: Member
Posts: 16,863
Joined: Sep 27 2012
Gold: 150,385.00
Feb 18 2023 12:17am
Quote (DanTravBABY @ Feb 18 2023 02:46am)
^ehmmkay is great

Helped him a bit already :)
Group: Trade Assistant
Posts: 19,118
Joined: Jul 26 2006
Gold: 16,149.00
Trader: Trusted
Feb 18 2023 04:54am
Feel free to send it over
Group: Member
Posts: 5
Joined: Jan 16 2023
Gold: 0.00
Mar 16 2023 02:20am
Hello this is Gulshan Negi
Well, to implement a loop for moving from room to room in a text-based game, you can follow some steps such as setting the starting room, asking the player for a direction to move, checking if the player can move in that direction, updating the current room if possible, and repeating until the game ends. Based on the dictionary of rooms and directions, you can use conditional statements and loops to implement these steps.
I think it is clear to you now.
Go Back To Programmer's Haven Topic List
Add Reply New Topic New Poll