From 310cd4cf633c2c968a59a9fefa92509ae1072aeb Mon Sep 17 00:00:00 2001 From: AdrianClv Date: Thu, 11 Dec 2014 17:43:58 +0100 Subject: [PATCH] Added the number to isNumberBet[] and initialize variables --- contractGamblingGame | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/contractGamblingGame b/contractGamblingGame index 8ebbaf1..dfd9c0f 100644 --- a/contractGamblingGame +++ b/contractGamblingGame @@ -2,6 +2,8 @@ contract GamblingGame{ //Create a gambling game that takes a maximum of nubBets bets function GamblingGame(uint8 _maxNumBets){ maxNumBets = _maxNumBets; + numBets = 0; + pot = 0; } function bet(uint8 numberBet){ @@ -15,11 +17,12 @@ contract GamblingGame{ //Map the bet and increase the number of bets numbersMap[numBets]=numberBet; userBet[numberBet]=sender; + isNumberBet[numberBet] = true; numBets++; //check if the number of bets has reached the limit if(numBets==maxNumBets){ - solveBets; + solveBets(); } @@ -77,4 +80,3 @@ contract GamblingGame{ } -