Split some code to view
[troll.git] / src / main / java / com / codingame / game / Model.java
index b98de7d..b310fdd 100644 (file)
@@ -7,4 +7,28 @@ class Model {
     int roadLength;
     int initialStones;
     int trollPosition;
     int roadLength;
     int initialStones;
     int trollPosition;
+
+    void init(long seed) {
+        random = new Random(seed);
+        switch (random.nextInt(4)) {
+        case 0:
+            roadLength = 6;
+            initialStones = 15;
+            break;
+        case 1:
+            roadLength = 6;
+            initialStones = 30;
+            break;
+        case 2:
+            roadLength = 14;
+            initialStones = 30;
+            break;
+        case 3:
+            roadLength = 14;
+            initialStones = 50;
+            break;
+        }
+
+        trollPosition = roadLength / 2;
+    }
 }
 }