gitweb on Svarog
projekti pod git sistemom za održavanje verzija -- projects under the git version control system
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fe1bfd7)
raw | patch | inline | side by side (parent: fe1bfd7)
author | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 30 Aug 2015 14:15:42 +0000 (16:15 +0200) | ||
committer | Doni Pracner <quinnuendo@gmail.com> | |
Sun, 30 Aug 2015 14:15:42 +0000 (16:15 +0200) |
diff --git a/samples/RekFac.mj b/samples/RekFac.mj
index 40817fd9b0f0e560c88f7cf03c9fa1fa2a2706d0..674cc14804aef54c9cc215dbf1c6c1a44b80467c 100644 (file)
--- a/samples/RekFac.mj
+++ b/samples/RekFac.mj
int factorial(int f)
{
- if (f<0) return 0;
- if (f<=1) return 1;
+ if (f<0)
+ return 0;
+ if (f<=1)
+ return 1;
return factorial(f-1) * f ;
}
diff --git a/samples/RekFib.mj b/samples/RekFib.mj
index f4e3f097f67e54256633e288bac8d2a2000a9d32..d3a59a50b519ae85b39f7841797d48a3e9332a7a 100644 (file)
--- a/samples/RekFib.mj
+++ b/samples/RekFib.mj
int fib(int f)
{
- if (f==0) return 0;
- if (f==1) return 1;
+ if (f==0)
+ return 0;
+ if (f==1)
+ return 1;
return fib(f-2)+fib(f-1) ;
}
diff --git a/samples/div0.mj b/samples/div0.mj
index d8fb689209baecc0cc8a5c4fd6a3ec21844be92f..bd92135e94028ee0ebc99fbeafc58f1a40e432a9 100644 (file)
--- a/samples/div0.mj
+++ b/samples/div0.mj
void main()\r
int i, j;\r
{\r
- i = 100; j = 0;\r
+ i = 100; \r
+ j = 0;\r
print(i/j);\r
}\r
\r
diff --git a/samples/div2.mj b/samples/div2.mj
index d498e3d1835931b65a23200ed9bd7b4a4c9bb4e3..455b4af4afbaf80b0eaec91300d585f2c050c526 100644 (file)
--- a/samples/div2.mj
+++ b/samples/div2.mj
void main()\r
int i, j;\r
{\r
- i = 100; j = 2;\r
+ i = 100; \r
+ j = 2;\r
print(i/j);\r
}\r
\r
diff --git a/samples/eratos.mj b/samples/eratos.mj
index 620bd2daa1af7fe783cd2fd6adbd5a075b94239d..92d28f88b65b66fbbc814aecfde16e997cf7fc1e 100644 (file)
--- a/samples/eratos.mj
+++ b/samples/eratos.mj
{\r
void put(int x)\r
{\r
- if (npp == 10) {print(chr(13)); print(chr(10)); npp = 0;}\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
put(x);\r
i = x;\r
- while (i <= max) {sieve[i] = 'o'; i = i + x;}\r
+ while (i <= max) {\r
+ sieve[i] = 'o'; i = i + x;\r
+ }\r
}\r
\r
void main()\r
npp = 0;\r
sieve = new char[max+1];\r
i = 0;\r
- while (i <= max) {sieve[i] = 'x'; i++;}\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') i++;\r
+ while(i <= max && sieve[i] == 'o') \r
+ i++;\r
}\r
}\r
\r
diff --git a/samples/pos-neg.mj b/samples/pos-neg.mj
index 5bf3771e1f2e7366da4270cff4f65a7f044ea199..79fd45477cdf06766f76b6f4ec2a60ec3b803f09 100644 (file)
--- a/samples/pos-neg.mj
+++ b/samples/pos-neg.mj
int x, i;
{ //---------- Initialize val
val = new Table;
- val.pos = new int[size]; val.neg = new int[size];
+ val.pos = new int[size];
+ val.neg = new int[size];
i = 0;
while (i < size) {
- val.pos[i] = 0; val.neg[i] = 0;
+ val.pos[i] = 0;
+ val.neg[i] = 0;
i++;
}
//---------- Read values