From: Doni Pracner Date: Wed, 30 Jul 2014 20:18:07 +0000 (+0200) Subject: new InOut samples, one for a char, other for branching X-Git-Tag: v0.2.0~10 X-Git-Url: http://svarog.pmf.uns.ac.rs/gitweb/?p=mjc2wsl.git;a=commitdiff_plain;h=6dc62f4d854849045be6915835145c54538af4d4;ds=sidebyside new InOut samples, one for a char, other for branching --- diff --git a/samples/InOut2.mj b/samples/InOut2.mj new file mode 100644 index 0000000..7c81f38 --- /dev/null +++ b/samples/InOut2.mj @@ -0,0 +1,10 @@ +program InOut2{ + void main() + char c; + { + print('c'); + print('?'); + read(c); + print(c); + } +} \ No newline at end of file diff --git a/samples/InOut3.mj b/samples/InOut3.mj new file mode 100644 index 0000000..73d7ddd --- /dev/null +++ b/samples/InOut3.mj @@ -0,0 +1,23 @@ +program InOut3{ + void main() + char c; + int i; + { + i = 5; + print('c'); + print('?'); + read(c); + print(c); + print(chr(10)); + if (c=='y') { + print('i'); + read(i); + } else { + print('c'); + read(c); + } + print(chr(10)); + print(i,5); + print(c,5); + } +} \ No newline at end of file