Skip to main content
added 334 characters in body
Source Link

A few remarks:

  1. Sleep duration is hard coded, it can be automatically calculated (depending on the text length).
  2. Display can be a function (including the sleep function).
  3. So you can just pass the string, it prints and waits.
  4. Instead of comparing the user input to Yes, yes and YES, you can simply compare the uppercase’d input to YES.
  5. Game design: you can consider having a kind of map (linked list, or some other data structure) for the players location (scenes), and another data structure for the game state (a simple inventory, like key, book, secret words, etc). This will make developing the game more an artwork rather than typing in the game into the code.

A few remarks:

  1. Sleep duration is hard coded, it can be automatically calculated (depending on the text length).
  2. Display can be a function (including the sleep function).
  3. So you can just pass the string, it prints and waits.
  4. Instead of comparing the user input to Yes, yes and YES, you can simply compare the uppercase’d input to YES.

A few remarks:

  1. Sleep duration is hard coded, it can be automatically calculated (depending on the text length).
  2. Display can be a function (including the sleep function).
  3. So you can just pass the string, it prints and waits.
  4. Instead of comparing the user input to Yes, yes and YES, you can simply compare the uppercase’d input to YES.
  5. Game design: you can consider having a kind of map (linked list, or some other data structure) for the players location (scenes), and another data structure for the game state (a simple inventory, like key, book, secret words, etc). This will make developing the game more an artwork rather than typing in the game into the code.
Source Link

A few remarks:

  1. Sleep duration is hard coded, it can be automatically calculated (depending on the text length).
  2. Display can be a function (including the sleep function).
  3. So you can just pass the string, it prints and waits.
  4. Instead of comparing the user input to Yes, yes and YES, you can simply compare the uppercase’d input to YES.