Class: CodeRotateInstruction

Inherits:
Instruction show all
Includes:
RotateInstruction
Defined in:
lib/instructions/code/code_rotate.rb

Overview

pops the top 3 items of the :code 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 :code

pushes: 3 :code

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) ⇒ CodeRotateInstruction

Returns a new instance of CodeRotateInstruction.



14
15
16
# File 'lib/instructions/code/code_rotate.rb', line 14

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