import std/deques import std/strutils import std/sequtils import std/re type MoveInstruction = object n: int source: int destination: int Stack[T] = Deque[T] let instructionRe = re(r"move (\d+) from (\d+) to (\d+)") proc parse(instr: string): (seq[Stack[char]], seq[MoveInstruction]) = let x = instr.split("\n\n") rawInitialState = x[0] rawInstructions = x[1] var stateLines = rawInitialState.splitlines() stateLines = stateLines[0..