private bool Scan(long x, long y) { bot.ClearInputs(); bot.ReadyInput(x); bot.ReadyInput(y); return(bot.RunProgram().FirstOrDefault() == 1); }
protected override string SolvePartOne() { long lastItem = long.MinValue; cpu.ReadyInput(1); foreach (long item in cpu.RunProgram()) { Console.WriteLine(item); lastItem = item; } return(lastItem.ToString()); }
protected override string SolvePartOne() { bot.ClearInputs(); foreach (char c in "NOT A J\nNOT C T\nOR T J\nAND D J\nWALK\n") { bot.ReadyInput(c); } var output = bot.RunProgram().ToList(); if (output.Count > 1) { foreach (var n in output) { if (n < 255) { Write((char)n); } } } return(output.Last().ToString()); }
protected override string SolvePartOne() { bot.ClearInputs(); foreach (var c in bot.RunProgram(true)) { if (c == long.MinValue) { continue; } if (c == long.MaxValue) { if (bot.Inputs.Count != 0) { continue; } string toBot = Console.ReadLine(); if (toBot == "EXIT") { break; } foreach (char c3 in toBot) { bot.ReadyInput(c3); } bot.ReadyInput('\n'); continue; } char c2 = (char)c; Write(c2); if (c2 == '?') { continue; } } return("Check your console"); }