package com.codingame.game;
import java.util.List;
+import java.util.Random;
import java.util.regex.Pattern;
import java.util.Scanner;
public class Player extends AbstractMultiplayerPlayer {
Model.Player model;
View.Player view;
+ Random random = new Random();
@Override
public int getExpectedOutputLines() {
}
// same-typed positional parameters… a disaster waiting to happen
- void gameInit(int roadLength, int initialStones) {
- sendInputLine(String.format("%d %d", roadLength, initialStones));
+ void gameInit(int roadLength, int initialStones, long seed) {
+ int nReserved = random.nextInt(5);
+ String reserved = "";
+ while (nReserved --> 0) reserved += " 0";
+ sendInputLine(String.format("%d %d %d %d%s",
+ roadLength, initialStones, seed,
+ model.getMultiplier(), reserved));
}
void sendGameTurn() {