From 6dc62f4d854849045be6915835145c54538af4d4 Mon Sep 17 00:00:00 2001 From: Doni Pracner Date: Wed, 30 Jul 2014 22:18:07 +0200 Subject: [PATCH 1/1] new InOut samples, one for a char, other for branching --- samples/InOut2.mj | 10 ++++++++++ samples/InOut3.mj | 23 +++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 samples/InOut2.mj create mode 100644 samples/InOut3.mj 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 -- 2.17.1