gitweb on Svarog

projekti pod git sistemom za održavanje verzija -- projects under the git version control system
new sample - fields
authorDoni Pracner <quinnuendo@gmail.com>
Thu, 12 Jun 2014 14:17:54 +0000 (16:17 +0200)
committerDoni Pracner <quinnuendo@gmail.com>
Thu, 12 Jun 2014 14:17:54 +0000 (16:17 +0200)
samples/fields.mj [new file with mode: 0644]

diff --git a/samples/fields.mj b/samples/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
Svarog.pmf.uns.ac.rs/gitweb maintanance Doni Pracner