您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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