Python Forum
Text Adventure Tutorial - if structure to dictionary
Thread Rating:
  • 2 Vote(s) - 4.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text Adventure Tutorial - if structure to dictionary
#7
I would suggest to modify the dictionary whitespace to make it better to read and understand what is going on there based on this thread.
rooms = {
    'empty': {
        'name': 'an empty room', 
        'east': 'bedroom', 
        'north': 'temple',
        'text': 'The stone floors and walls and cold and damp.'},
    'temple': {
        'name': 'a small temple', 
        'east': 'torture', 
        'south': 'empty',
        'text': 'There are three rows of benches facing a small statue.'},
    'torture': {
        'name': 'a torture chamber', 
        'west': 'temple', 
        'south': 'bedroom',
        'text': 'There is a rack and an iron maiden against the wall\nand some chains and thumbscrews on the floor.'},
    'bedroom': {
        'name': 'a bedroom', 
        'north': 'torture', 
        'west': 'empty',
        'text': 'There is a large bed with black, silk sheets on it.'}
    }
Recommended Tutorials:


Messages In This Thread
RE: Text Adventure Tutorial - by metulburr - Oct-03-2016, 10:02 PM
RE: Text Adventure Tutorial - by ichabod801 - Oct-04-2016, 12:44 AM
RE: Text Adventure Tutorial - by metulburr - Oct-04-2016, 01:28 AM
RE: Text Adventure Tutorial - by Skaperen - Oct-04-2016, 06:23 AM
RE: Text Adventure Tutorial - if structure to dictionary - by metulburr - Jun-19-2019, 11:51 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020