Brord icon

Coffee script (?)

Brord | PRO | 03/30/15 08:24:45 AM UTC | 0 ⭐ | 664 👁️ | Never ⏰ | []
Java |

1.04 KB

|

None

|

0 👍

/

0 👎

class School {
    public static void main(String[] args){
        Brord b = new Brord();
        b.startCoding();
    }
}
 
class Brord extends AwesomePerson {
    private static int coffeeRequired = Integer.MAX_INT;
    
    private int coffee = 0;
    
    public Brord(){
        startActivity(Coffee.class, getMethod("startCoding"), getMethod("stopCoding");
    }
    
    public boolean isBrainActive(){
        return coffee > 0;
    }
    
    public void stopCoding(){
        Bram b = PersonManager.findPerson(Bram.class);
        if (b != null && b.isBrainActive()){
            starActivity(BuyCoffee.class, b, getMethod("startCoding"), stopCoding());
        }
    }
    
    public synchronised startCoding(){
        while (coffee > 0){
            codeLine();
            wait(min_to_milsec(10));
            coffee--;
        }
        
    }
}
 
class Coffee extends ActiveTask {
    Coffee(AwesomePerson person, Runnable startTask){
        person.drink(this);
        startTask.run();
    }
}
 
class BuyCoffee extends ActiveMultiPersonTask {
    Coffee(AwesomePerson person, Runnable startTask, AwesomePerson ... other){
        person.drink(this);
        startTask.run();
    }
}

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎