Last active
August 29, 2015 14:10
-
-
Save JobLeonard/ca947302bae5ee12e940 to your computer and use it in GitHub Desktop.
Céu: organisms within organisms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloWorld with | |
var int id; | |
do | |
_printf("[%d] Hello world!\n", this.id); | |
every 1s do | |
_printf("[%d] Hello world!\n", this.id); | |
end | |
end | |
class HelloMulticellular with | |
pool HelloWorld[] hs; | |
var int i; | |
do | |
every 1s do | |
// "this.id = this.i" won't work, obviously. | |
// Is there a better workaround? | |
// Design opening for better syntactic sugar? | |
var int t = this.i; | |
spawn HelloWorld in this.hs with | |
this.id = t; | |
end; | |
this.i = t + 1; | |
end | |
end | |
loop do | |
var HelloMulticellular hmc with | |
this.i = 1; | |
end; | |
await 5s; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can use "outer":
(I'll answer your e-mail in the list later...)