Class: IntRotateInstruction

Inherits:
Instruction show all
Includes:
RotateInstruction
Defined in:
lib/instructions/int/int_rotate.rb

Overview

pops the top 3 items of the :int stack; pushes them back in rotated order

If they were A, B and C (with C originally at the top of the stack) the result will be B, C, A (with A at the top)

needs: 3 :int

pushes: 3 :int

Instance Attribute Summary

Attributes included from RotateInstruction

#target_stack

Attributes inherited from Instruction

#context

Instance Method Summary collapse

Methods included from RotateInstruction

#cleanup, #derive, #preconditions?, #setup

Methods inherited from Instruction

all_instructions, #cleanup, #derive, #go, inherited, #needs, #preconditions?, #pushes, #setup, to_nudgecode

Constructor Details

#initialize(context) ⇒ IntRotateInstruction

Returns a new instance of IntRotateInstruction.



14
15
16
# File 'lib/instructions/int/int_rotate.rb', line 14

def initialize(context)
  super(context, :int)
end