static RobotSimulation init() { int step = (stepCount * stepCount) / robotCount; RobotSimulation sim = new RobotSimulation(roomCellsSize); Random r = new Random(); for (int i = 0; i < robotCount; i++) { bool movable = r.Next(unmovableDenominator) != 0; int x = (i * step) / roomCellsSize; int y = (i * step) % roomCellsSize; sim.CreateRobot(x, y, movable); } return(sim); }