A 139-byte implementation of the dice game Pig.
Open the index.html
file in your preferred web browser. Alternatively, the
game can be played via Node.JS by running node index.js
from the command line,
but note that this will actually polyfill some browser functions and therefore
you will be playing an ungolfed version of the game.
The prompt that is displayed will show three numbers:
- The first number is the player's ID (it will be either
0
or1
). - The second number is the player's total.
- The third number is the player's turn total.
If you want to roll the dice, type something into the prompt, then confirm. If you want to stick with what you have rolled so far, just leave the box empty, and your score will be updated and the next player's turn will begin.
This code is unlicensed.