Someone asked for a dice game on steem, and I figured that may be a good training to get to know the apis better.
A beta version is done, I dare you to test it!
You probably know the drill: select a number between 0 and 100 and bet on a higher or lower result. Every block rolls a dice. The last 5 characters of the block hash the transaction is in gets converted to decimal, if it's >999,999 the next block is taken (and so on). The resulting integer x gives the result against which your number is checked: x%(10000)/100
The amount you get when you guessed right is sent * (100/(100-number OR 0+number))
minus the house edge, which is set to 1% for now. The limit for one game is a theoretical winning of 10 Steem, when your bet exceeds that it'll get returned on the spot.
I will create a frontend later. When you're brave enough, send a bit of Steem to the account steemdice1
with a memo formatted like this:
{"type":"higher","number":23.6}
or
{"type":"lower","number":75}
Don't gamble high amounts, I only filled the account with 100 STEEM for the tests. If something goes wrong I won't take any blame.