Open dckc opened 2 months ago
based on discussion with @kriskowal
playground/packages/fun-games$ endo make src/rock-paper-scissors.js -n p1
Object [Alleged: RockPaperScissors] {}
playground/packages/fun-games$ endo eval "E(p1).attack('rock')" p1 -n p2
Object [Alleged: Defender] {}
playground/packages/fun-games$ endo eval "E(p2).defend('paper')" p2
{ why: 'paper covers rock', winner: 2 }
added some unit tests too:
$ yarn test
yarn run v1.22.21
$ ava
✔ Rock Paper Scissors: 1 game
ℹ {
why: 'paper covers rock',
winner: 2,
}
✔ only 3 choices allowed
✔ attacker cannot attack again
─
3 tests passed
goal:
but I get: