package net.ciklum.icfpc11.controller.ai import net.ciklum.icfpc11.parser.Command import static net.ciklum.icfpc11.domain.Card.* import static net.ciklum.icfpc11.parser.Application.LEFT import static net.ciklum.icfpc11.parser.Application.RIGHT /** * blabla * @author vic */ @Typed class DumbLoopStrategy implements Strategy { private final List commands private int index DumbLoopStrategy(List commands) { this.commands = commands if (commands.size() == 0) { throw new IllegalArgumentException('zero-length loop strategy') } this.index = 0 } Command getNextCommand() { Command res = commands[index] index++ if (index >= commands.size()) index = 0 res } boolean isComplete() { false } public static final List DEC_AFTER_COMMANDO45 = [ new Command(RIGHT, 7, zero), // 0 new Command(LEFT, 7, get), // 255 (from oth cell) new Command(LEFT, 7, dec) // dec the 0th (255-255) cell ] }