public APad ProcessClick(int logicalX, int logicalY) { if (LastCommand.IsOneOf(CommandType.Continue, CommandType.WaitClick)) { return(From(Program, Exp.Call(Program, Memory.ToExp(), CoreImplementations.Pair(logicalX, logicalY)))); } throw new InvalidOperationException(LastCommand.ToString()); }
public static Exp ToExp(this Data?data) { return(data switch { null => CoreImplementations.emptyList, NumData n => n.Value, PairData pair => CoreImplementations.Pair(pair.Value.ToExp(), pair.Next.ToExp()), _ => throw new NotSupportedException($"{data}") });
public static APad Boot(Exp prog) { return(From(prog, Exp.Call(prog, CoreImplementations.emptyList, CoreImplementations.Pair(0, 0)))); }