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.

3 年之前
3 年之前
3 年之前
3 年之前
3 年之前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. -v, --verbose Print detailed information about each game.
  30. This gets very long; probably don't use it if
  31. you're asking for a large number of games!
  32. -n, --numruns [N] The number of games to simulate. Default: 10000
  33. -m, --multiwin Announce on the console when a game ends in a
  34. multi-win. This can lead to a lot of output.
  35. -i, --instructions Print these instructions and exit without
  36. doing anything else.
  37. ### Mutually Exclusive Options:
  38. -a, --alt Use Wanderer's algorithm for determining when
  39. to spend potatoes to reduce orcs. This spends
  40. a potato if ORCS could win this round and
  41. POTATOES could not, OR if ORCS is greater than
  42. one and a 1d10 comes up less than the ORCS
  43. score. It will only spend a potato if there
  44. are enough potatoes to spend.
  45. -p, --potatoper [N] Use the Potato-Per algorithm for determining
  46. when to spend potatoes to reduce orcs. This
  47. spends a potato when the ratio of POTATOES to
  48. ORCS rises above a certain amount, modified by
  49. the POTATOES cost to reduce ORCS by 1. It will
  50. only spend a potato if there are enough
  51. potatoes to spend.