benjaminrathelot / javascript-poker-engine

Client side and server side javascript poker engine : manage players, get hands value, get winner, side pots management. Contact me if you need a working multiplayer server side nodejs version (nodejs/socket.io + benjaminrathelot javascript-poker-engine)
MIT License
4 stars 3 forks source link

Bet condition #1

Open Identity-labs opened 4 years ago

Identity-labs commented 4 years ago

Hi,

Can you improve this bet condition in more than one if ? if(amount<=player.credits && (amount >= this.bigBlind || this.pot == 0 && this.currentHigh == 0 || player.currentBet == this.smallBlind && amount == this.smallBlind) && ((amount+player.currentBet)>=this.currentHigh || player.currentBet==-1 && (amount+player.currentBet+1)>=this.currentHigh || this.currentHigh==this.bigBlind && amount==this.smallBlind && player.currentBet==this.smallBlind))

Like if(amount > player.credits) return 'Not enought credits'; if(amount < this.bigBlind) return 'The min amount is ' + this.bigBlind; ...

I'm not good in poker to make that correctly :)

Thanks

benjaminrathelot commented 3 years ago

Hello,

Sure. Will do soon!