Split some code to view
[troll.git] / src / main / java / com / codingame / game / Model.java
1 package com.codingame.game;
2
3 import java.util.Random;
4
5 class Model {
6     Random random;
7     int roadLength;
8     int initialStones;
9     int trollPosition;
10
11     void init(long seed) {
12         random = new Random(seed);
13         switch (random.nextInt(4)) {
14         case 0:
15             roadLength = 6;
16             initialStones = 15;
17             break;
18         case 1:
19             roadLength = 6;
20             initialStones = 30;
21             break;
22         case 2:
23             roadLength = 14;
24             initialStones = 30;
25             break;
26         case 3:
27             roadLength = 14;
28             initialStones = 50;
29             break;
30         }
31
32         trollPosition = roadLength / 2;
33     }
34 }