gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
move samples to 'alpha-mj' subfolder
authorDoni Pracner <quinnuendo@gmail.com>
Fri, 19 Jul 2019 12:27:14 +0000 (14:27 +0200)
committerDoni Pracner <quinnuendo@gmail.com>
Fri, 19 Jul 2019 12:27:14 +0000 (14:27 +0200)
33 files changed:
build.xml
samples/ArrayTest.mj [deleted file]
samples/ArraysTest.mj [deleted file]
samples/InOut1.mj [deleted file]
samples/InOut2.mj [deleted file]
samples/InOut3.mj [deleted file]
samples/Rek1.mj [deleted file]
samples/RekFac.mj [deleted file]
samples/RekFib.mj [deleted file]
samples/alpha-mj/ArrayTest.mj [new file with mode: 0644]
samples/alpha-mj/ArraysTest.mj [new file with mode: 0644]
samples/alpha-mj/InOut1.mj [new file with mode: 0644]
samples/alpha-mj/InOut2.mj [new file with mode: 0644]
samples/alpha-mj/InOut3.mj [new file with mode: 0644]
samples/alpha-mj/Rek1.mj [new file with mode: 0644]
samples/alpha-mj/RekFac.mj [new file with mode: 0644]
samples/alpha-mj/RekFib.mj [new file with mode: 0644]
samples/alpha-mj/chrtest.mj [new file with mode: 0644]
samples/alpha-mj/div0.mj [new file with mode: 0644]
samples/alpha-mj/div2.mj [new file with mode: 0644]
samples/alpha-mj/eratos.mj [new file with mode: 0644]
samples/alpha-mj/fields.mj [new file with mode: 0644]
samples/alpha-mj/linkedlist.mj [new file with mode: 0644]
samples/alpha-mj/pos-neg.mj [new file with mode: 0644]
samples/alpha-mj/while-print.mj [new file with mode: 0644]
samples/chrtest.mj [deleted file]
samples/div0.mj [deleted file]
samples/div2.mj [deleted file]
samples/eratos.mj [deleted file]
samples/fields.mj [deleted file]
samples/linkedlist.mj [deleted file]
samples/pos-neg.mj [deleted file]
samples/while-print.mj [deleted file]

index a9dac9f59c05695648e97c25f63a0f8711cdb497..762aef3448059dd8656e15eff8928a9488401f2e 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -47,8 +47,8 @@
     <property name="compiler.classname.interpreter" value="MJ.Run" />
     <property name="compiler.classname.decoder" value="MJ.Decode" />
 
-    <property name="samples.main.dir" value="samples" />
-    <property name="samples.temp.dir" value="temp" />
+    <property name="samples.main.dir" value="samples/alpha-mj" />
+    <property name="samples.temp.dir" value="temp/alpha-mj" />
 
     <property name="transf.wsl.file" value="src-wsl/hill_climbing.wsl" />
     <property name="transf.wsl.ini" value="transf.ini" />
diff --git a/samples/ArrayTest.mj b/samples/ArrayTest.mj
deleted file mode 100644 (file)
index c55ffd1..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-program ArrayTest
-       int[] arr;
-       int i;
-       int max;
-{
-       void main(){
-               max = 10;
-               arr = new int[max];
-               i = 0;
-               while (i<max){
-                       arr[i] = max-i;
-                       i++;
-               }
-               i = 0;
-               while (i<len(arr)){
-                       print(arr[i],3);
-                       i++;
-               }
-       }
-}
\ No newline at end of file
diff --git a/samples/ArraysTest.mj b/samples/ArraysTest.mj
deleted file mode 100644 (file)
index e9ae981..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-program ArraysTest
-{
-       void rek_arr(int i)
-       int[] a; int loc, loc2; {
-               if (i>1){ 
-                               a = new int[i];
-                               loc = 0;
-                               loc2 = 1;
-                               while (loc<i){
-                                       a[loc] = loc2;
-                                       loc++;
-                                       loc2 = loc2 * i;
-                               }
-                               rek_arr(i-1);
-                               loc = 0;
-                               while (loc<i){
-                                       print(a[loc],3);
-                                       loc++;
-                               }
-                               print(0,5);
-               }
-       }
-
-       void main() int max;
-       {
-               max = 5;
-               rek_arr(max);
-       }
-}
\ No newline at end of file
diff --git a/samples/InOut1.mj b/samples/InOut1.mj
deleted file mode 100644 (file)
index 1b9a499..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-program InOut1{
-       void main()
-       int i;
-       {
-                       print('?');
-                       read(i);
-                       print(i);
-       }
-}
\ No newline at end of file
diff --git a/samples/InOut2.mj b/samples/InOut2.mj
deleted file mode 100644 (file)
index 7c81f38..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-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
deleted file mode 100644 (file)
index 73d7ddd..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-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
diff --git a/samples/Rek1.mj b/samples/Rek1.mj
deleted file mode 100644 (file)
index 41ab83b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-program Rek1{
-       void func(int i){
-               print(i);
-               if (i>0) 
-                       func(i-1);
-       }
-       
-       void main() {
-               func(5);
-       }
-}
\ No newline at end of file
diff --git a/samples/RekFac.mj b/samples/RekFac.mj
deleted file mode 100644 (file)
index 674cc14..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-program RekFac{
-
-       int factorial(int f)
-       {
-               if (f<0) 
-                       return 0;
-               if (f<=1) 
-                       return 1;
-               return factorial(f-1) * f ;
-       }
-       
-       void main()
-       {
-               print(factorial(3),3);
-               print(factorial(10),10);
-       }
-}
\ No newline at end of file
diff --git a/samples/RekFib.mj b/samples/RekFib.mj
deleted file mode 100644 (file)
index d3a59a5..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-program RekFib{
-
-       int fib(int f)
-       {
-               if (f==0) 
-                       return 0;
-               if (f==1) 
-                       return 1;
-               return fib(f-2)+fib(f-1) ;
-       }
-       
-       void main()
-       {
-               print(fib(0),3);
-               print(fib(2),3);
-               print(fib(7),3);
-       }
-}
\ No newline at end of file
diff --git a/samples/alpha-mj/ArrayTest.mj b/samples/alpha-mj/ArrayTest.mj
new file mode 100644 (file)
index 0000000..c55ffd1
--- /dev/null
@@ -0,0 +1,20 @@
+program ArrayTest
+       int[] arr;
+       int i;
+       int max;
+{
+       void main(){
+               max = 10;
+               arr = new int[max];
+               i = 0;
+               while (i<max){
+                       arr[i] = max-i;
+                       i++;
+               }
+               i = 0;
+               while (i<len(arr)){
+                       print(arr[i],3);
+                       i++;
+               }
+       }
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/ArraysTest.mj b/samples/alpha-mj/ArraysTest.mj
new file mode 100644 (file)
index 0000000..e9ae981
--- /dev/null
@@ -0,0 +1,29 @@
+program ArraysTest
+{
+       void rek_arr(int i)
+       int[] a; int loc, loc2; {
+               if (i>1){ 
+                               a = new int[i];
+                               loc = 0;
+                               loc2 = 1;
+                               while (loc<i){
+                                       a[loc] = loc2;
+                                       loc++;
+                                       loc2 = loc2 * i;
+                               }
+                               rek_arr(i-1);
+                               loc = 0;
+                               while (loc<i){
+                                       print(a[loc],3);
+                                       loc++;
+                               }
+                               print(0,5);
+               }
+       }
+
+       void main() int max;
+       {
+               max = 5;
+               rek_arr(max);
+       }
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/InOut1.mj b/samples/alpha-mj/InOut1.mj
new file mode 100644 (file)
index 0000000..1b9a499
--- /dev/null
@@ -0,0 +1,9 @@
+program InOut1{
+       void main()
+       int i;
+       {
+                       print('?');
+                       read(i);
+                       print(i);
+       }
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/InOut2.mj b/samples/alpha-mj/InOut2.mj
new file mode 100644 (file)
index 0000000..7c81f38
--- /dev/null
@@ -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/alpha-mj/InOut3.mj b/samples/alpha-mj/InOut3.mj
new file mode 100644 (file)
index 0000000..73d7ddd
--- /dev/null
@@ -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
diff --git a/samples/alpha-mj/Rek1.mj b/samples/alpha-mj/Rek1.mj
new file mode 100644 (file)
index 0000000..41ab83b
--- /dev/null
@@ -0,0 +1,11 @@
+program Rek1{
+       void func(int i){
+               print(i);
+               if (i>0) 
+                       func(i-1);
+       }
+       
+       void main() {
+               func(5);
+       }
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/RekFac.mj b/samples/alpha-mj/RekFac.mj
new file mode 100644 (file)
index 0000000..674cc14
--- /dev/null
@@ -0,0 +1,17 @@
+program RekFac{
+
+       int factorial(int f)
+       {
+               if (f<0) 
+                       return 0;
+               if (f<=1) 
+                       return 1;
+               return factorial(f-1) * f ;
+       }
+       
+       void main()
+       {
+               print(factorial(3),3);
+               print(factorial(10),10);
+       }
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/RekFib.mj b/samples/alpha-mj/RekFib.mj
new file mode 100644 (file)
index 0000000..d3a59a5
--- /dev/null
@@ -0,0 +1,18 @@
+program RekFib{
+
+       int fib(int f)
+       {
+               if (f==0) 
+                       return 0;
+               if (f==1) 
+                       return 1;
+               return fib(f-2)+fib(f-1) ;
+       }
+       
+       void main()
+       {
+               print(fib(0),3);
+               print(fib(2),3);
+               print(fib(7),3);
+       }
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/chrtest.mj b/samples/alpha-mj/chrtest.mj
new file mode 100644 (file)
index 0000000..ddc0b8b
--- /dev/null
@@ -0,0 +1,11 @@
+program P
+{
+       void main()
+       {
+                       print(chr(65),5);
+                       print('A',5);
+                       print(chr(10),2);
+                       print(ord('a'),5);
+                       print('a',5);
+       }
+}
diff --git a/samples/alpha-mj/div0.mj b/samples/alpha-mj/div0.mj
new file mode 100644 (file)
index 0000000..bd92135
--- /dev/null
@@ -0,0 +1,11 @@
+program test\r
+{\r
+       void main()\r
+               int i, j;\r
+       {\r
+               i = 100; \r
+               j = 0;\r
+               print(i/j);\r
+       }\r
+\r
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/div2.mj b/samples/alpha-mj/div2.mj
new file mode 100644 (file)
index 0000000..455b4af
--- /dev/null
@@ -0,0 +1,11 @@
+program test\r
+{\r
+       void main()\r
+               int i, j;\r
+       {\r
+               i = 100; \r
+               j = 2;\r
+               print(i/j);\r
+       }\r
+\r
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/eratos.mj b/samples/alpha-mj/eratos.mj
new file mode 100644 (file)
index 0000000..92d28f8
--- /dev/null
@@ -0,0 +1,47 @@
+program Eratos\r
+\r
+       char[] sieve;\r
+       int max;                // maximum prime to be found\r
+       int npp;                // numbers per page\r
+\r
+{\r
+       void put(int x)\r
+       {\r
+               if (npp == 10) {\r
+                       print(chr(13)); \r
+                       print(chr(10)); \r
+                       npp = 0;\r
+               }\r
+               print(x, 5);\r
+               npp++;\r
+       }\r
+       \r
+       void found(int x)\r
+               int i;\r
+       {\r
+               put(x);\r
+               i = x;\r
+               while (i <= max) {\r
+                       sieve[i] = 'o'; i = i + x;\r
+               }\r
+       }\r
+\r
+       void main()\r
+               int i;\r
+       {\r
+               read(max);\r
+               npp = 0;\r
+               sieve = new char[max+1];\r
+               i = 0;\r
+               while (i <= max) {\r
+                       sieve[i] = 'x'; i++;\r
+               }\r
+               i = 2;\r
+               while (i <= max) {\r
+                       found(i);\r
+                       while(i <= max && sieve[i] == 'o') \r
+                               i++;\r
+               }\r
+       }\r
+\r
+}//test
\ No newline at end of file
diff --git a/samples/alpha-mj/fields.mj b/samples/alpha-mj/fields.mj
new file mode 100644 (file)
index 0000000..f29fb26
--- /dev/null
@@ -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
diff --git a/samples/alpha-mj/linkedlist.mj b/samples/alpha-mj/linkedlist.mj
new file mode 100644 (file)
index 0000000..6d04746
--- /dev/null
@@ -0,0 +1,85 @@
+program linkedlist
+       class Element {
+               int info;
+               Element next;
+       }
+       Element first;
+{
+       void add(int i) 
+       Element newone;
+       {       
+               newone = new Element;
+               newone.info = i;
+               newone.next = first;
+               first = newone; 
+       }
+
+       void printlist() 
+       Element cur;
+       {
+               cur = first;
+               while (cur != null) {
+                       print(cur.info);
+                       cur = cur.next;
+               }
+       }
+
+       int exists(int i) Element cur; {
+               cur = first;
+               while (cur != null && cur.info != i)
+                       cur = cur.next;
+               if (cur != null)
+                       return 1;
+               else
+                       return 0;
+       }       
+
+       int count(int i) Element cur; int c;{
+               cur = first;
+               c = 0;
+               while (cur != null) {
+                       if (cur.info == i)
+                               c++;
+                       cur = cur.next;
+               }
+               return c;
+       }       
+
+       void main()
+       int num; int in; int c; {
+               print('l');
+               print('?');
+               read(num);
+               // demo
+               if (num<0) {
+                       add(1);
+                       add(2);
+                       add(3);
+                       add(2);
+                       printlist();
+                       print(exists(7));
+                       print(count(2));
+               } else {
+                       c = 0;
+                       while (c<num) {
+                               print(c);
+                               print('?');
+                               read(in);
+                               add(in);
+                               c++;
+                       }
+                       printlist();
+
+                       print('e');
+                       print('?');
+
+                       read(in);
+                       print(exists(in));
+
+                       print('c');
+                       print('?');
+                       read(in);
+                       print(count(in));
+               }
+       }
+}
\ No newline at end of file
diff --git a/samples/alpha-mj/pos-neg.mj b/samples/alpha-mj/pos-neg.mj
new file mode 100644 (file)
index 0000000..79fd454
--- /dev/null
@@ -0,0 +1,42 @@
+program P
+       final int size = 10;
+       class Table {
+               int[] pos;
+               int[] neg;
+       }
+       Table val;
+{
+       void main()
+               int x, i;
+       { //---------- Initialize val
+               val = new Table;
+               val.pos = new int[size]; 
+               val.neg = new int[size];
+               i = 0;
+               while (i < size) {
+                       val.pos[i] = 0; 
+                       val.neg[i] = 0;
+                       i++;
+               }
+       //---------- Read values
+               read(x);
+               while (x != 0) {
+                       if (0 <= x && x < size) {
+                               val.pos[x]++;
+                       } else if (-size < x && x < 0) {
+                               val.neg[-x]++;
+                       }
+                       read(x);
+               }
+       
+       // output everything
+               i = 0;
+               while (i < size) {
+                       print(i,3);
+                       print(val.pos[i],5);
+                       print(val.neg[i],5);
+                       print(chr(10));
+                       i++;
+               }
+       }
+}
diff --git a/samples/alpha-mj/while-print.mj b/samples/alpha-mj/while-print.mj
new file mode 100644 (file)
index 0000000..cdc0851
--- /dev/null
@@ -0,0 +1,12 @@
+program P\r
+{\r
+       void main()\r
+               int i;\r
+       { \r
+               i = 0;\r
+               while (i < 5) {\r
+                       print(i);\r
+                       i = i + 1;\r
+               }\r
+       }\r
+}\r
diff --git a/samples/chrtest.mj b/samples/chrtest.mj
deleted file mode 100644 (file)
index ddc0b8b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-program P
-{
-       void main()
-       {
-                       print(chr(65),5);
-                       print('A',5);
-                       print(chr(10),2);
-                       print(ord('a'),5);
-                       print('a',5);
-       }
-}
diff --git a/samples/div0.mj b/samples/div0.mj
deleted file mode 100644 (file)
index bd92135..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-program test\r
-{\r
-       void main()\r
-               int i, j;\r
-       {\r
-               i = 100; \r
-               j = 0;\r
-               print(i/j);\r
-       }\r
-\r
-}
\ No newline at end of file
diff --git a/samples/div2.mj b/samples/div2.mj
deleted file mode 100644 (file)
index 455b4af..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-program test\r
-{\r
-       void main()\r
-               int i, j;\r
-       {\r
-               i = 100; \r
-               j = 2;\r
-               print(i/j);\r
-       }\r
-\r
-}
\ No newline at end of file
diff --git a/samples/eratos.mj b/samples/eratos.mj
deleted file mode 100644 (file)
index 92d28f8..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-program Eratos\r
-\r
-       char[] sieve;\r
-       int max;                // maximum prime to be found\r
-       int npp;                // numbers per page\r
-\r
-{\r
-       void put(int x)\r
-       {\r
-               if (npp == 10) {\r
-                       print(chr(13)); \r
-                       print(chr(10)); \r
-                       npp = 0;\r
-               }\r
-               print(x, 5);\r
-               npp++;\r
-       }\r
-       \r
-       void found(int x)\r
-               int i;\r
-       {\r
-               put(x);\r
-               i = x;\r
-               while (i <= max) {\r
-                       sieve[i] = 'o'; i = i + x;\r
-               }\r
-       }\r
-\r
-       void main()\r
-               int i;\r
-       {\r
-               read(max);\r
-               npp = 0;\r
-               sieve = new char[max+1];\r
-               i = 0;\r
-               while (i <= max) {\r
-                       sieve[i] = 'x'; i++;\r
-               }\r
-               i = 2;\r
-               while (i <= max) {\r
-                       found(i);\r
-                       while(i <= max && sieve[i] == 'o') \r
-                               i++;\r
-               }\r
-       }\r
-\r
-}//test
\ No newline at end of file
diff --git a/samples/fields.mj b/samples/fields.mj
deleted file mode 100644 (file)
index f29fb26..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-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
diff --git a/samples/linkedlist.mj b/samples/linkedlist.mj
deleted file mode 100644 (file)
index 6d04746..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-program linkedlist
-       class Element {
-               int info;
-               Element next;
-       }
-       Element first;
-{
-       void add(int i) 
-       Element newone;
-       {       
-               newone = new Element;
-               newone.info = i;
-               newone.next = first;
-               first = newone; 
-       }
-
-       void printlist() 
-       Element cur;
-       {
-               cur = first;
-               while (cur != null) {
-                       print(cur.info);
-                       cur = cur.next;
-               }
-       }
-
-       int exists(int i) Element cur; {
-               cur = first;
-               while (cur != null && cur.info != i)
-                       cur = cur.next;
-               if (cur != null)
-                       return 1;
-               else
-                       return 0;
-       }       
-
-       int count(int i) Element cur; int c;{
-               cur = first;
-               c = 0;
-               while (cur != null) {
-                       if (cur.info == i)
-                               c++;
-                       cur = cur.next;
-               }
-               return c;
-       }       
-
-       void main()
-       int num; int in; int c; {
-               print('l');
-               print('?');
-               read(num);
-               // demo
-               if (num<0) {
-                       add(1);
-                       add(2);
-                       add(3);
-                       add(2);
-                       printlist();
-                       print(exists(7));
-                       print(count(2));
-               } else {
-                       c = 0;
-                       while (c<num) {
-                               print(c);
-                               print('?');
-                               read(in);
-                               add(in);
-                               c++;
-                       }
-                       printlist();
-
-                       print('e');
-                       print('?');
-
-                       read(in);
-                       print(exists(in));
-
-                       print('c');
-                       print('?');
-                       read(in);
-                       print(count(in));
-               }
-       }
-}
\ No newline at end of file
diff --git a/samples/pos-neg.mj b/samples/pos-neg.mj
deleted file mode 100644 (file)
index 79fd454..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-program P
-       final int size = 10;
-       class Table {
-               int[] pos;
-               int[] neg;
-       }
-       Table val;
-{
-       void main()
-               int x, i;
-       { //---------- Initialize val
-               val = new Table;
-               val.pos = new int[size]; 
-               val.neg = new int[size];
-               i = 0;
-               while (i < size) {
-                       val.pos[i] = 0; 
-                       val.neg[i] = 0;
-                       i++;
-               }
-       //---------- Read values
-               read(x);
-               while (x != 0) {
-                       if (0 <= x && x < size) {
-                               val.pos[x]++;
-                       } else if (-size < x && x < 0) {
-                               val.neg[-x]++;
-                       }
-                       read(x);
-               }
-       
-       // output everything
-               i = 0;
-               while (i < size) {
-                       print(i,3);
-                       print(val.pos[i],5);
-                       print(val.neg[i],5);
-                       print(chr(10));
-                       i++;
-               }
-       }
-}
diff --git a/samples/while-print.mj b/samples/while-print.mj
deleted file mode 100644 (file)
index cdc0851..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-program P\r
-{\r
-       void main()\r
-               int i;\r
-       { \r
-               i = 0;\r
-               while (i < 5) {\r
-                       print(i);\r
-                       i = i + 1;\r
-               }\r
-       }\r
-}\r
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner