Skip to content

Instantly share code, notes, and snippets.

@Mercerenies
Created February 15, 2022 01:51
Show Gist options
  • Save Mercerenies/2b5f94e109b8e66fd17a8c0de572cf4a to your computer and use it in GitHub Desktop.
Save Mercerenies/2b5f94e109b8e66fd17a8c0de572cf4a to your computer and use it in GitHub Desktop.
multi sub to_instruction(Str $x, Int $pos is rw) {
given $x {
when '>' {
$pos += 1;
Empty
}
when '<'
$pos -= 1;
Empty
}
default {
Instruction.new(atom => $x, target => $pos)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment