@MisterBoring said in Code Question: Rock, Paper, Scissors:
You do have a point about RPS strategy that I hadn’t considered, so perhaps having the command be a bit more interactive so that each player inputs their choice.
If it only ever runs one game at a time, you can run it so you rps <choice> and it creates a data attribute on an object. If you’re the first player, it stores your data and emits something about “waiting for 2nd player…”
If it already has one DATA-* attribute, then it knows you’re the second player, and it resolves the match, emits the resolution, and wipes the data.
If it already has two DATA-* attributes, then it is broken. 😄