Hotfix: (from @pb4) a dead player isn't granted an early termination
[troll.git] / config / Boss.java
1 import java.util.Random;
2 import java.util.Scanner;
3
4 class Player {
5     private final static String[] messages = {
6         "meta⁵ @YannT ∷ (a → b) → f1 (f2 (f3 a)) → f1 (f2 (f3 b))",
7         "By the power of Grayskull!",
8         "tortue",
9         "how is ur csb",
10         "YHBT"
11     };
12     public static void main(String[] args) {
13         Scanner in = new Scanner(System.in);
14         Random random = new Random();
15
16         int roadLength = in.nextInt();
17         int initialStones = in.nextInt();
18         in.nextLong(); // seed
19         in.nextInt(); // side
20         in.nextLine();
21
22         while (true) {
23             int trollDistance = in.nextInt();
24             int stones = in.nextInt();
25             int opponentStones = in.nextInt();
26
27             if (random.nextInt(30) == 0) {
28                 System.out.println(random.nextInt(stones+1) + " " +
29                                    messages[random.nextInt(messages.length)]);
30             }
31             else {
32                 System.out.println(random.nextInt(stones+1));
33             }
34         }
35     }
36 }