X-Git-Url: https://troll.desast.re/troll.git/blobdiff_plain/20c63dac92d830a4c61f6d17ecfb8e7e0d04e58d..798b92dbe890d45ae15aa896f78a6f60dd84b89e:/src/main/java/com/codingame/game/Model.java?ds=inline diff --git a/src/main/java/com/codingame/game/Model.java b/src/main/java/com/codingame/game/Model.java index b98de7d..b310fdd 100644 --- a/src/main/java/com/codingame/game/Model.java +++ b/src/main/java/com/codingame/game/Model.java @@ -7,4 +7,28 @@ class Model { 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; + } }