Rulet kodları, yapmak sitedğim 36 sayı yerine 5 sayı yapmak ve betOnNumber sayıyı kulancıdan almak. Kodda 36 ve 37 değerlerini değiştirip (5 ile ) betOnNumber sonuçu alamıyorum. Olgrüp olmadı. Nasıl değiştirmeliyim ki Bana 5 sayı üzerinden betOnNumber sonucunu versin? pragma solidity ^0.4.8; contract OwnedByWinsome { address public owner; mapping allowedWorker; function initOwnership internal function allowWorker onlyOwner function removeWorker onlyOwner function changeOwner onlyOwner modifier onlyAllowedWorker{ if _; } modifier onlyOwner{ if _; } } / Math operations with safety checks / library SafeMath { function mul internal returns function div internal returns function sub internal returns function add internal returns function max64(uint64 a, uint64 b) internal constant returns (uint64) function min64(uint64 a, uint64 b) internal constant returns (uint64) function max256(uint256 a, uint256 b) internal constant returns (uint256) function min256(uint256 a, uint256 b) internal constant returns (uint256) function assert internal { if } } / Basic token Basic version of StandardToken, with no allowances / contract BasicToken { using SafeMath for uint; event Transfer ; mapping balances; uint public totalSupply = 0; // Total supply of 500 million Tokens / Fix for the ERC20 short address attack / modifier onlyPayloadSize { if(msg. data. length < size + 4) _; } function transfer onlyPayloadSize(2 32) function balanceOf constant returns } contract StandardToken is BasicToken{ event Approval ; mapping (address => mapping allowed; function transferFrom function approve function allowance constant returns } contract WinToken is StandardToken, OwnedByWinsome{ string public name = "Winsome.io Token"; string public symbol = "WIN"; uint public decimals = 18; mapping allowedMinter; function WinToken function allowMinter onlyOwner function removeMinter onlyOwner modifier onlyAllowedMinter{ if _; } function mintTokens onlyAllowedMinter function destroyTokens onlyAllowedMinter } contract Rouleth { //Game and Global Variables, Structure of gambles address public developer; uint8 public blockDelay; //nb of blocks to wait before spin uint8 public blockExpiration; //nb of blocks before bet expiration uint256 public maxGamble; //max gamble value manually set by config uint256 public minGamble; //min gamble value manually set by config mapping pendingTokens; address public WINTOKENADDRESS; WinToken winTokenInstance; uint public emissionRate; //Gambles enum BetTypes struct Gamble Gamble private gambles; //Tracking progress of players mapping gambleIndex; //current gamble index of the player //records current status of player enum Status mapping playerStatus; // // Management & Config FUNCTIONS // // function Rouleth //creation settings modifier onlyDeveloper function addBankroll onlyDeveloper payable function removeBankroll(uint256 _amount_wei) onlyDeveloper function changeDeveloper_only_Dev onlyDeveloper //Change some settings within safety bounds function changeSettings_only_Dev(uint256 newMinGamble, uint256 newMaxGamble, uint8 newBlockDelay, uint8 newBlockExpiration, uint newEmissionRate) onlyDeveloper // // BETTING FUNCTIONS // // // //basic betting without Mist or contract call //activates when the player only sends eth to the contract //without specifying any type of bet. function payable // //Guarantees that gamble is under max bet and above min. // returns bet value function checkBetValue private returns(uint256) { if throw; if else } //Function record bet called by all others betting functions function placeBet private { if //Once this is done, we can record the new bet playerStatus = Status. waitingForSpin; gambleIndex = gambles. length; //adapts wager to casino limits uint256 betValue = checkBetValue ; pendingTokens += betValue emissionRate; gambles. push(Gamble(msg. sender, false, false, betType, input, betValue, block. number, 0, 37)); //37 indicates not spinned yet //refund excess bet if } function getPendingTokens constant returns function redeemTokens // //bet on Number function betOnNumber payable // // function betOnColor //bet type : color //input : 0 for red //input : 1 for black function betOnColor payable { uint input; if else placeBet ; } // // function betOnLow_High //bet type : lowhigh //input : 0 for low //input : 1 for low function betOnLowHigh payable { uint input; if else placeBet ; } // // function betOnOddEven //bet type : parity //input : 0 for even //input : 1 for odd function betOnOddEven payable { uint input; if else placeBet ; } // // function betOnDozen // //bet type : dozen // //input : 0 for first dozen // //input : 1 for second dozen // //input : 2 for third dozen function betOnDozen(uint dozen_selected_0_1_2) payable // // // function betOnColumn // //bet type : column // //input : 0 for first column // //input : 1 for second column // //input : 2 for third column function betOnColumn(uint column_selected_0_1_2) payable // // Spin The Wheel & Check Result FUNCTIONS// // event Win(address player, uint8 result, uint value_won, bytes32 bHash, bytes32 sha3Player, uint gambleId, uint bet); event Loss(address player, uint8 result, uint value_loss, bytes32 bHash, bytes32 sha3Player, uint gambleId, uint bet); // //function to spin callable // no eth allowed function spinTheWheel function SpinTheWheel private returns { if (playerSpinned 0) //check that player has to spin if return false; //redundent double check : check that gamble has not been spinned already if throw; //check that the player waited for the delay before spin //and also that the bet is not expired uint playerblock = gambles[gambleIndex ]. blockNumber; //too early to spin if throw; //too late, bet expired, player lost else if solveBet(playerSpinned, 255, false, 1, 0, 0) ; //spin! else return true; } //CHECK BETS FUNCTIONS private function checkBetResult(uint8 result, address player, bytes32 blockHash, bytes32 shaPlayer) private // function solve Bet once result is determined : sends to winner, adds loss to profit function solveBet(address player, uint8 result, bool win, uint8 multiplier, bytes32 blockHash, bytes32 shaPlayer) private { //Update status and record spinned playerStatus =Status. waitingForBet; gambles[gambleIndex ]. wheelResult=result; gambles[gambleIndex ]. spinned=true; gambles[gambleIndex ]. blockSpinned=block. number; uint bet_v = gambles[gambleIndex ]. wager; if else } // checkbeton number // bet type : number // input : chosen number function checkBetNumber(uint8 result, address player, bytes32 blockHash, bytes32 shaPlayer) private { bool win; //win if solveBet(player, result, win,36, blockHash, shaPlayer); } // checkbet on oddeven // bet type : parity // input : 0 for even, 1 for odd function checkBetParity(uint8 result, address player, bytes32 blockHash, bytes32 shaPlayer) private { bool win; //win if (result%2 gambles[gambleIndex ]. input && result!=0) solveBet(player, result, win,2, blockHash, shaPlayer); } // checkbet on lowhigh // bet type : lowhigh // input : 0 low, 1 high function checkBetLowhigh(uint8 result, address player, bytes32 blockHash, bytes32 shaPlayer) private { bool win; //win if (result!=0 && ( (result<19 && gambles[gambleIndex ]. input 0) || (result>18 && gambles[gambleIndex ]. input 1) ) ) solveBet(player, result, win,2, blockHash, shaPlayer); } // checkbet on color // bet type : color // input : 0 red, 1 black uint red_list= ; function checkBetColor(uint8 result, address player, bytes32 blockHash, bytes32 shaPlayer) private { bool red; //check if red for (uint8 k; k<18; k++) { if } bool win; //win if ( result!=0 && ( (gambles[gambleIndex ]. input 0 && red) || ( gambles[gambleIndex ]. input 1 && ! red) ) ) solveBet(player, result, win,2, blockHash, shaPlayer); } // checkbet on dozen // bet type : dozen // input : 0 first, 1 second, 2 third function checkBetDozen(uint8 result, address player, bytes32 blockHash, bytes32 shaPlayer) private { bool win; //win on first dozen if ( result!=0 && ( (result<13 && gambles[gambleIndex ]. input 0) || (result>12 && result<25 && gambles[gambleIndex ]. input 1) || (result>24 && gambles[gambleIndex ]. input 2) ) ) solveBet(player, result, win,3, blockHash, shaPlayer); } // checkbet on column // bet type : column // input : 0 first, 1 second, 2 third function checkBetColumn(uint8 result, address player, bytes32 blockHash, bytes32 shaPlayer) private { bool win; //win if ( result!=0 && ( (gambles[gambleIndex ]. input 0 && result%3 1) || ( gambles[gambleIndex ]. input 1 && result%3 2) || ( gambles[gambleIndex ]. input 2 && result%3 0) ) ) solveBet(player, result, win,3, blockHash, shaPlayer); } function checkMyBet constant returns(Status player_status, BetTypes bettype, uint input, uint value, uint8 result, bool wheelspinned, bool win, uint blockNb, uint blockSpin, uint gambleID) function getTotalGambles constant returns function getGamblesList(uint256 index) constant returns(address player, BetTypes bettype, uint input, uint value, uint8 result, bool wheelspinned, bool win, uint blockNb, uint blockSpin) } //end of contract ran tarafından 06/Tem/17 21:49 tarihinde düzenlenmiştir Bilmem kaçıncı galaksiden gelen gama ışınlarına maruz kalmak için Pipimizi açıkta tutup UFO konmasını bekledik