Skip to content

Instantly share code, notes, and snippets.

@dublindan
Created February 18, 2010 17:42
Show Gist options
  • Save dublindan/307880 to your computer and use it in GitHub Desktop.
Save dublindan/307880 to your computer and use it in GitHub Desktop.
@std.in;
a = [[int\]] <- 0;
op = [[char\]] <- ' ';
b = [[int\]] <- 0;
r = [[int\]] <- 0;
0 {
clock => [[int ms]] {
("\r" + ms/1000.0 + ":" + a + op + b + "=" + r) ->std.out;
1 std.delay
(ms+1) clock
}
};
inLoop => {
\in ->a
\in ->op
\in ->b
inLoop
};
\\op ?? {
'+': (\a + \b)
'-': (\a - \b)
'*': (\a*\b)
'/': (\a/\b)
: 0
} ->r;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment