Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Worker extends Thread{
- private int turn;
- private String word;
- public Worker(int turn, String word){
- this.turn = turn;
- this.word = word;
- this.start();
- }
- public void run(){
- while(true){
- if(Game.getTurn() == turn){
- System.out.println(word);
- Game.invTurn();
- }
- else
- this.yield();
- }
- }
- }
Add Comment
Please, Sign In to add comment