Author | Message |
---|---|
ytsai8
Posts: 47
|
Posted 21:10 Feb 26, 2014 |
So the bug I am having is that when one of the player's money is equal to 0, (1) it is returning Invalid and automatically loses (2) it's his or her last all-in move (and wins), it returns Invalid, but the person still wins the game. However, I realize even when one player is bankrupted, the game might still be a tie (when another one's money is less than the position he or she needs to earn in order to win, the prize would not reach position 0 or 10). Here is my doMove() method, can anybody help me debug or any hint???? public String doMoves(int p1bid, int p2bid) {
And here is one of the example output. P2-Invalid The final Winner is P1.
|