I thought some people might find this a bit of fun: Pig Dice game in your browser.
In case you don't know the game, it's very simple: you take turns rolling a die, and accumulating points for your turn. You can stop at any time and keep the points you've rolled, but if you roll a 1, your turn is over and you gain nothing. First player to the goal (currently 32 points in this version) wins!
There's a version of Pig Dice in Mini Micro (in /sys/demo), but not all MiniScript users use Mini Micro. And anyway, I needed a version of the code that was considerably simpler — I'm working on a book for new programmers, and for this place in the book, I haven't introduced lists or maps yet. So I had to do the whole game with only while
and if
.
The result is a refreshingly simple bit of code that plays a fun little game. Give it a try!