a larger while example
need a way to see the code
This commit is contained in:
parent
315be69851
commit
89e221c748
@ -1,6 +1,6 @@
|
||||
|
||||
body
|
||||
background-color: black
|
||||
background-color: #1a1a1a
|
||||
color: white
|
||||
|
||||
.one_class, .classes, .vool_view ,.mom_view , .risc_view, .status_view ,.vool_view
|
||||
@ -81,9 +81,9 @@ body
|
||||
background-color: #009900
|
||||
|
||||
.risc_bright , .mom_bright
|
||||
padding-right: 6px
|
||||
padding-left: 6px
|
||||
background-color: #00E3FF
|
||||
background-color: black
|
||||
font-size: 1.2rem
|
||||
color: #53a5ff
|
||||
border-radius: 7px
|
||||
|
||||
.fade_in
|
||||
|
@ -63,18 +63,18 @@ class SelectView < ElementView
|
||||
ruby = get_codes[code]
|
||||
Vool::VoolCompiler.ruby_to_vool( as_main(ruby) )
|
||||
machine.objects
|
||||
puts "starting"
|
||||
@interpreter.start machine.risc_init
|
||||
end
|
||||
def as_main(statements)
|
||||
"class Space ;def main(arg) ; #{statements}; end; end"
|
||||
end
|
||||
def get_codes
|
||||
{set_internal_byte: "return 'Hello'.set_internal_byte(1,75)" ,
|
||||
called_if: 'if( 10 ); return "then";else;return "else";end' ,
|
||||
hello_world: "h = 'Hello World'.putstring;return h",
|
||||
dynamic_call: "a = 150 ; return a.div10",
|
||||
}
|
||||
{ while_with_calls: 'a = 0; while( 0 > a); a = 1 + a;end;return a',
|
||||
set_internal_byte: "return 'Hello'.set_internal_byte(1,75)" ,
|
||||
called_if: 'if( 10 ); return "then";else;return "else";end' ,
|
||||
hello_world: "h = 'Hello World'.putstring;return h",
|
||||
dynamic_call: "a = 150 ; return a.div10",
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user