internal static void Doit(State s) { s.DoesAutoVerify = false; LocateBots(s); VoidAll(s); GatherBots(s); s.DoTurn(new [] { Commands.Halt() }); }
internal override void Solve() { Inspect(); MoveToY(MaxY + 1); Prepare(); Execute(); Cleanup(); S.DoTurn(new [] { Commands.Halt() }); }
private static Command ReadCommand(Stream stream) { int b1 = stream.ReadByte(); switch (b1) { case -1: return(null); case 0b11111111: return(Commands.Halt()); case 0b11111110: return(Commands.Wait()); case 0b11111101: return(Commands.Flip()); } if ((b1 & 0b11001111) == 0b00000100) { return(ReadSMove(b1, stream)); } if ((b1 & 0b00001111) == 0b00001100) { return(ReadLMove(b1, stream)); } switch (b1 & 0b00000111) { case 0b111: return(ReadFusionP(b1, stream)); case 0b100: return(ReadFusionS(b1, stream)); case 0b101: return(ReadFission(b1, stream)); case 0b011: return(ReadFill(b1, stream)); case 0b010: return(ReadVoid(b1, stream)); case 0b001: return(ReadGFill(b1, stream)); case 0b000: return(ReadGVoid(b1, stream)); } throw new IOException($"Invalid first byte: {b1}."); }
internal override Command DecodeText(IReadOnlyList <string> args) => Commands.Halt();
internal override Command Decode(int prefix, Func <int> nextByte) => Commands.Halt();