Sha256: 800ab5c2d5d09480027104aa49bb30771b68172a2c68967c5b47b09ee57703b2

Contents?: true

Size: 179 Bytes

Versions: 1

Compression:

Stored size: 179 Bytes

Contents

module Whitespace::ISA
  class Swap < Instruction
    def execute
      a = vm.vstack.pop
      b = vm.vstack.pop

      vm.vstack.push a
      vm.vstack.push b
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whitespace-ruby-1.0.0 lib/whitespace/instructions/stack_manipulation/swap.rb