| |
BGonline.org Forums
BG Buddy speedgammon demo
Posted By: Boop In Response To: BG Buddy speedgammon demo (niuniuch)
Date: Thursday, 4 May 2017, at 12:09 p.m.
Hi, as discussed and requested by Dmitriy Obukhov and Jacek Wojciechowski in this thread, I’ve added the secret code for dice generation option to BG Buddy. Each player enters a (up to) 4 digit secret number. These are combined to make the seed for the Mersenne Twister random number generator. The 8 digit number translates to 100 million possible seeds. Another secret random number generated by BG Buddy (between 0 and 5 million) is used as an offset for the first and subsequent dice rolls.
At the end of the match the seed and the offset number become visible in the Saved Matches window allowing a third party to re-generate the dice and check that BG Buddy has not doctored the dice in any way.
BG Buddy offers an “Export Dice” option that exports 2 text files. via email. 1) The dice rolls that BG Buddy received from the generator as players rolled. 2) A dice rolls file regenerated at the time of export using the displayed seed and offset. These 2 files will be the same :-)
This version has just gone into beta for the next few days before it gets released. If anyone wishes to view/test it before then please email me at bgbuddyfeedback@gmail.com and i’ll send you a free invite.
All you need is an iPhone or iPad. This is possible for new users or owners of BG Buddy and there is no cost incurred in either case.
BG Buddy is written in objective C. Here’s the dice code:
#import < GameplayKit/GameplayKit.h >
//Generate a random source from a seed.
GKMersenneTwisterRandomSource *randomSource = [[GKMersenneTwisterRandomSource alloc] initWithSeed:seed];
// set distribution from 1 to 6
_randomDistribution = [[GKRandomDistribution alloc] initWithRandomSource:randomSource lowestValue:1 highestValue:6];
// ask for the next number
int nextNumber = [_randomDistribution nextInt];
Ross
| |
BGonline.org Forums is maintained by Stick with WebBBS 5.12.