You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.0KB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # Simulator for Potato, a one-page RPG
  2. See https://twitter.com/deathbybadger/status/1567425842526945280 for details.
  3. **Potato** is a single-player, one-page RPG where you play as a halfling,
  4. farming and harvesting potatoes while the Dark Lord amasses his forces
  5. elsewhere in the world.
  6. You have three scores: DESTINY, POTATOES, and ORCS. Each round, you
  7. roll d6 to determine which type of event you experience: a day in the
  8. garden, a knock at the door, or a darkening of the world.
  9. For the first two, you then roll a second d6 to determine how your
  10. scores change; the third event makes it cost more potatoes to get rid
  11. of orcs. (At the beginning of the game, you can spend 1 potato to
  12. reduce your ORCS score by 1.) If any score reaches 10, the game ends
  13. with that score's ending; if DESTINY and ORCS reach 10 in the same
  14. round, ORCS wins, and if DESTINY and POTATOES reach 10 in the same
  15. round, you get a multi-win. (ORCS and POTATOES can never reach 10 in
  16. the same round.)
  17. When the simulator has simulated the requested number of games, it will
  18. report its results: the number and percentage of wins for each score
  19. type, and the mean and median number of rounds it took to win a game.
  20. ## How to run it
  21. The simulator requires Python 3.6+, but it doesn't need any third-party
  22. libraries. To run it, download `potato_game.py`, navigate to the directory
  23. you downloaded it to, and run `python3 potato_game.py` in the command line.
  24. This will run the simulator with the default settings: *not* verbose,
  25. *not* multiwin, *no* potato-spending algorithm, and *10,000* iterations.
  26. To change the simulator's behavior, you can use various option flags
  27. on the command line. You can use more than one option at once.
  28. ## Game Options
  29. | Short | Extended | Description |
  30. | :---- | :------------- | :---------- |
  31. | -v | --verbose | Print detailed information about each game.<br>This gets very long; probably don't use it if<br>you're asking for a large number of games! |
  32. | -n | --numruns N | Simulate N games. Default: 10000 |
  33. | -m | --multiwin | Announce on the console when a game ends in a<br>multi-win. This can lead to a lot of output. |
  34. | -i | --instructions | Print these instructions and exit without doing anything else. |
  35. ### Mutually Exclusive Options:
  36. | Short | Extended | Description |
  37. | :---- | :------------- | :---------- |
  38. | -a | --alt | Use Wanderer's algorithm for determining when<br>to spend potatoes to reduce orcs. This spends<br>a potato if ORCS could win this round and<br>POTATOES could not, OR if ORCS is greater than<br>one and a 1d10 comes up less than the ORCS<br>score. It will only spend a potato if there<br>are enough potatoes to spend. |
  39. | -p | --potatoper N | Use the Potato-Per algorithm for determining<br>when to spend potatoes to reduce orcs, using<br>a ratio of N potatoes to 1 orc. This spends<br>a potato when the ratio of POTATOES to ORCS rises<br>above a certain amount, modified by the<br>POTATOES cost to reduce ORCS by 1.<br>It will only spend a potato if there<br>are enough potatoes to spend. |