• Post Reply Bookmark Topic Watch Topic
  • New Topic

Game loop freezing  RSS feed

 
Alex Vestin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I'm back with a question about the Black Jack assignment. I've created a working game that works for one round, aswell as a resetbutton thats able to clear the board of the old hand. However the runGame() loop, which checks wether a player has played his hand seems to freeze the programme the second time around


I know it's probably not optimal having an while loop constantly running to check the status, but I can't seem to figure out why it freezes.

Thanks in advance!
 
Knute Snortum
Sheriff
Posts: 4281
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Think about what happens when the dealer has 20 or 21 points.
 
Alex Vestin
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply!

The if-statement on 16 was off, since when the points were over 19 line 21 and 23 got unreachable. I removed line 16, and it's working




 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!