a larger while example

need a way to see the code
This commit is contained in:
Torsten Ruger 2018-04-20 19:40:17 +03:00
parent 315be69851
commit 89e221c748
2 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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