Enum advent_solutions::advent2017::day23::Instruction
[−]
[src]
pub enum Instruction {
Set(char, Value),
Sub(char, Value),
Mul(char, Value),
Jnz(Value, Value),
}The code it's running seems to be a variant of the kind you saw recently on that tablet. The general functionality seems very similar, but some of the instructions are different:
-
set X Ysets registerXto the value ofY. -
sub X Ydecreases registerXby the value ofY. -
mul X Ysets registerXto the result of multiplying the value contained in registerXby the value ofY. -
jnz X Yjumps with an offset of the value ofY, but only if the value ofXis not zero. (An offset of2skips the next instruction, an offset of-1jumps to the previous instruction, and so on.)
Variants
Set(char, Value)Sub(char, Value)Mul(char, Value)Jnz(Value, Value)
Methods
impl Instruction[src]
pub fn from_bytes(i: &[u8]) -> IResult<&[u8], Instruction, u32>
pub fn list_from_bytes(i: &[u8]) -> IResult<&[u8], Vec<Instruction>, u32>
Trait Implementations
impl Copy for Instruction[src]
impl Clone for Instruction[src]
fn clone(&self) -> Instruction[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl PartialEq for Instruction[src]
fn eq(&self, __arg_0: &Instruction) -> bool[src]
This method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, __arg_0: &Instruction) -> bool[src]
This method tests for !=.
impl Eq for Instruction[src]
impl Debug for Instruction[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more