]> ruin.nu Git - proglang.git/commitdiff
moved comments to examples
authorMichael Andreen <harv@ruin.nu>
Tue, 7 Feb 2006 10:18:09 +0000 (10:18 +0000)
committerMichael Andreen <harv@ruin.nu>
Tue, 7 Feb 2006 10:18:09 +0000 (10:18 +0000)
documentation
examples/fib
examples/if
examples/sum
examples/var

index cb693df417c88f4430589c5ac0de2ce533360c91..cf26d0aafadec73cf148288555cd48e3ee6ea6ef 100644 (file)
@@ -1,8 +1,6 @@
 ####### DOCUMENTATIATOIAITAT ION ########
 
 
 ####### DOCUMENTATIATOIAITAT ION ########
 
 
-
-
 a simple c-like language with support for if/else-statements, while-loops and the standard arithmetic (+, -, /, *) and comparison expressions (<, >, <=, >=, ==, !=). also, increase/decrease expressions (++, --) are supported.
 
 data types:
 a simple c-like language with support for if/else-statements, while-loops and the standard arithmetic (+, -, /, *) and comparison expressions (<, >, <=, >=, ==, !=). also, increase/decrease expressions (++, --) are supported.
 
 data types:
@@ -11,67 +9,3 @@ integers and booleans.
 comments:
 // and /* */ comments are allowed.
 
 comments:
 // and /* */ comments are allowed.
 
-
-
-
-
-
-
-
-
-
-
-
-
-examples:
-
-fib
----
-int n1 = 0;
-int n2 = 1;
-int n = readInt;
-
-while(n-- > 0){
-  int temp = n1+n2;
-  n1 = n2;
-  n2 = temp;
-}
-print n2;
-
-
-tests while, decr and assignment.
-
-
-
-if
---
-if (readBool) {
-  if (readInt < 0)
-    print true;
-  else
-    print false;
-}
-
-
-tests if and if/else.
-
-
-
-sum
----
-int n;
-int sum = 0;
-while ((n = readInt) != -1) sum = sum + n;
-print sum;
-
-
-
-
-var
----
-int a = 3;
-int b = a - 5;
-int c = a + b*7;
-bool d = a == b;
-
-tests simple variable operations.
\ No newline at end of file
index 0cf71f34c5aeba71a4674926ca1589fd4bbee9d1..3bad4e9eb33044ef0a7ced8e641e420307971eb0 100644 (file)
@@ -1,3 +1,6 @@
+/*
+tests while, decr and assignment.
+*/
 int n1 = 0;
 int n2 = 1;
 int n = readInt;
 int n1 = 0;
 int n2 = 1;
 int n = readInt;
index c002570c0670c9fee5ac555807204478339b1921..4f6040efd83e9541de7e29baf496194caf9e66de 100644 (file)
@@ -1,6 +1,9 @@
+/*
+tests if and if/else
+*/
 if (readBool) {
   if (readInt < 0)
     print true;
   else
     print false;
 if (readBool) {
   if (readInt < 0)
     print true;
   else
     print false;
-}
\ No newline at end of file
+}
index cda8206e2f89aeb94ed82279ac418e70172215ec..d39cfe64600bfb4d1e6a3bbd292b449ae7aaffd9 100644 (file)
@@ -1,3 +1,6 @@
+/*
+Tests assignment as expression
+*/
 int n;
 int sum = 0;
 
 int n;
 int sum = 0;
 
index 51c55843ef0c1872961f39982ee1fa2817f65ce8..17ce26270239e1192c4324653ff62dd6bb344acf 100644 (file)
@@ -1,3 +1,6 @@
+/*
+Tests simple variable assignments and expressions.
+*/
 int a = 3;
 int b = a - 5;
 int c = a + b*7;
 int a = 3;
 int b = a - 5;
 int c = a + b*7;