Skip to content

Instantly share code, notes, and snippets.

import os/Terminal
for (c in 30..38) {
Terminal setBgColor(c)
"Background %d" format(c) print()
Terminal reset()
Terminal setFgColor(c)
" Foreground %d" format(c) println()
Terminal reset()
}
import os/Terminal
Terminal setFgColor(Color white)
"Long time no see" println()
Terminal reset()
import os/Terminal
Terminal setFgColor(Color white)
"Long time no see" println()
Terminal reset()
int main() {
const int x = 10;
return x*2;
}
foo: func() -> Bool {
return false;
}
bar: func() -> Int {
return 0;
}
"First attempt: %s" format((bar() || foo() || 20) toString()) println()
"Second attempt: %s" format((foo() || bar() || 20) toString()) println()
scavenger@versus:~/Public/ooc/try$ cat soviet.ooc
import os/Time
str := Time microtime() toString() last()
("In Soviet Russia, " + str + " calculates YOU! \n") print()
scavenger@versus:~/Public/ooc/try$ OOC_SDK=/home/scavenger/Public/ooc/newrock/rock/sdk gdb --args rock soviet.ooc GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
scavenger@versus:/tmp$ OOC_SDK=~/Public/ooc/newrock/rock/sdk/ gdb --args rock high
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
import structs/ArrayList
import text/StringTokenizer
import os/Terminal
scanf: extern func(String) -> String
players: ArrayList<Player>
map: Map
winner: Player
import structs/ArrayList
state: ArrayList<String>
main: func() {
state add("Foo")
state add("Bar")
}
import bar
Foo: class {
}