This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes While loop not being executed in method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "While loop not being executed in method" Watch "While loop not being executed in method" New topic
Author

While loop not being executed in method

Sam Thompson
Ranch Hand

Joined: Jul 05, 2011
Posts: 93
    
    1
Hello everyone:

I am just wondering if some of you can give me a hand in finding out where the problem is in regards to my code. The method I am having trouble with is onTableAfterFlop().

This method simply asks the user to enter the cards face up during a flop in a poker game. From there it will perform various computations and tasks in determining probabilitie and possibilities of different hands.

However, I notice that for some reason the while loop isn't being executed? Can anyone figure out why exactly? I have double checked the parameters and everything looks fine. My code is inserted below:



Can anyone figure out where the obstruction is as to why it isn't working? Otherwise, it would be running fine. The PokerPlayer class is below this line.


Any help would be greatly appreciated.

Thanks everyone!

S.T.
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2176
    
  47
lastCardRecorded is false and so the while statement fails and hence the while loop body doesn't execute.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: While loop not being executed in method
 
Similar Threads
Creating a Circular LinkedList
Extracting and using items in ArrayLists
doubts in enum and generalized code
Method not working or operating in program
static insights?