Ejemplo n.º 1
0
        public override async Task Play()
        {
            Account account = await _accountProvider.GetAccountAcync();

            long seed = DateTimeOffset.UtcNow.ToUnixTimeSeconds();

            _playState = await GetSuccessfulPlayResponseAsync(account, 1, seed);

            int     counter = 0;
            MT19937 mt;
            long    nextNum = 0;

            do
            {
                seed += counter;
                mt    = new MT19937();
                mt.init_genrand((ulong)seed);
                counter++;
                nextNum = (long)mt.genrand_int32();
            } while (_playState.RealNumber != nextNum);

            while (_playState.Account.Money < 1000000)
            {
                nextNum    = (long)mt.genrand_int32();
                _playState = await GetSuccessfulPlayResponseAsync(
                    account : _playState.Account,
                    bet : (int)_playState.Account.Money.Value *_betPersentage / 100,
                    number : nextNum);
            }
        }
Ejemplo n.º 2
0
        public override async Task Play()
        {
            Account account = await _accountProvider.GetAccountAcync();

            var random = new Random();

            ulong[] states = new ulong[stateSize];
            var     mt     = new MT19937();

            for (int i = 0; i < stateSize; i++)
            {
                _playState = await GetSuccessfulPlayResponseAsync(
                    account : account,
                    bet : 1,
                    number : random.Next(0, 100));

                states[i] = mt.untempering((ulong)_playState.RealNumber);
            }

            mt = new MT19937();
            mt.init_genrand(states);
            long nextNum;

            while (_playState.Account.Money < 1000000)
            {
                nextNum    = (long)mt.genrand_int32();
                _playState = await GetSuccessfulPlayResponseAsync(
                    account : _playState.Account,
                    bet : (int)_playState.Account.Money.Value *_betPersentage / 100,
                    number : nextNum);
            }
        }