move registers to hash
This commit is contained in:
parent
aa2303ddaa
commit
2645f54d5b
@ -1,13 +1,13 @@
|
|||||||
class RegisterView
|
class RegisterView
|
||||||
|
|
||||||
include React::Component
|
include React::Component
|
||||||
required_param :registers, type: []
|
required_param :registers, type: {}
|
||||||
|
|
||||||
def render
|
def render
|
||||||
div :class => :row do
|
div :class => :row do
|
||||||
registers.each do |r|
|
registers.each do |r , has|
|
||||||
div :class => "col-md-1" do
|
div :class => "col-md-1" do
|
||||||
r
|
"#{r} : #{has}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -5,6 +5,6 @@ class Interpreter
|
|||||||
attr_accessor :registers
|
attr_accessor :registers
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@registers = (0...12).collect{|i| "r#{i}"}
|
@registers = Hash[(0...12).collect{|i| ["r#{i}" , "undefined"]}]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user