From e19d91ebbcdedfaecabcc531ce2abe0fab9c5efc Mon Sep 17 00:00:00 2001 From: Doni Pracner Date: Thu, 12 Jun 2014 16:17:54 +0200 Subject: [PATCH] new sample - fields --- samples/fields.mj | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 samples/fields.mj diff --git a/samples/fields.mj b/samples/fields.mj new file mode 100644 index 0000000..f29fb26 --- /dev/null +++ b/samples/fields.mj @@ -0,0 +1,44 @@ +program F + class HolderClass { + int simple; + int[] arry; + } + + HolderClass holder; + +{ + void main() + int i, size; + { + holder = new HolderClass; + holder.simple = 5; + + print(holder.simple,10); + + print(chr(10)); + + size = 5; + holder.arry = new int[size]; + holder.arry[0] = size+1; + i = 1; + while (i < size){ + holder.arry[i] = holder.arry[i-1]-1; + i++; + } + + i = 0; + while (i < size){ + print(holder.arry[i],3); + i++; + } + print(chr(10)); + + i = 0; + while (i < size){ + holder.arry[i]--; + print(holder.arry[i],3); + i++; + } + + } +} \ No newline at end of file -- 2.25.1