public static PurringMachine GetDefaultMachine() { PurringMachine m = new PurringMachine(); const bool fromLeft = false; m.SetInstructions(GetIncrementBinaryValueInstructionSet(), fromLeft); m.SetTapeData("1111"); m.Reset(); return(m); }
public ActionResult Index() { LoadMachineState(); if (Machine == null) { Machine = Machine.GetDefaultMachine(); SaveMachineState(); } ViewData["initTapeData"] = new string(Machine.Tape.ToArray()); return(View()); }
private void SetMachine(Machine machine) { Session["Machine"] = machine; }
private void LoadMachineState() { this.Machine = GetMachine(); }