Created
August 8, 2015 06:16
-
-
Save tinybike/6201be7ae1fd5a121f82 to your computer and use it in GitHub Desktop.
Print to stdout in Serpent
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
| event stdout(data) | |
| # prints an array to stdout | |
| # $a: array | |
| # $n: array length | |
| macro log_array($a, $n): | |
| with $i = 0: | |
| while $i < $n: | |
| log(type=stdout, $a[$i]) | |
| $i += 1 | |
| # print to stdout | |
| macro print($x): | |
| log(type=stdout, $x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment