Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

send message from thread to other

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following code to check the winner of the TicTacToe game, when any condition within is satisfied (for example here is first condition at line 8 ) I could send the current player a message with his result either he won or lost but I can't give the result of the game to the other player as I am in the current player thread, how could I do this.
I tried to switch to the other player through
but that don't work either
 
Marshal
Posts: 25671
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
None of that code should be sending any messages to the other player. The caller of that method is the one who should be sending such a message, if the method returns true. Pseudocode:


 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic