Created
September 30, 2019 21:01
-
-
Save arkhaminferno/7332b51639a19c9fc81984dec122a6d7 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.1+commit.c8a2cb62.js&optimize=false&gist=
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.1; | |
contract MultiNumberBettingV1{ | |
uint8 loserCount; | |
uint8 winnerCount; | |
uint8[3] numArray; | |
constructor (uint8 _p,uint8 _p2, uint8 _p3) public{ | |
numArray[0] = _p; | |
numArray[1] = _p2; | |
numArray[2] = _p3; | |
} | |
function guess(uint8 num) public returns(bool){ | |
for(uint8 i=0;i<numArray.length;i++){ | |
if(numArray[i] == num){ | |
winnerCount++; | |
return true; | |
} | |
else{ | |
loserCount++; | |
return false; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment