baum

changeset 39:96e2d58bc346

added new example program; added comments to example programs
author meillo@marmaro.de
date Sat, 01 Mar 2008 20:10:02 +0100
parents ff01f0f076e4
children 5c13e29bc6fd
files examples/helloworld.baum examples/sum3input.baum examples/sum3input_v2.baum
diffstat 3 files changed, 30 insertions(+), 0 deletions(-) [+]
line diff
     1.1 --- a/examples/helloworld.baum	Sat Mar 01 20:04:08 2008 +0100
     1.2 +++ b/examples/helloworld.baum	Sat Mar 01 20:10:02 2008 +0100
     1.3 @@ -1,5 +1,10 @@
     1.4  # hello world program for baum
     1.5  # http://prog.marmaro.de/baum
     1.6 +#
     1.7 +# prints "Hello World"
     1.8 +# and returns the answer to everything
     1.9 +#
    1.10 +# ... what fabulous program :-)
    1.11  
    1.12  sum(0)
    1.13  	print(99)
    1.14 @@ -27,3 +32,5 @@
    1.15  		number(100) #d
    1.16  	print(99)
    1.17  		number(10)  #\n
    1.18 +
    1.19 +	number(4)
     2.1 --- a/examples/sum3input.baum	Sat Mar 01 20:04:08 2008 +0100
     2.2 +++ b/examples/sum3input.baum	Sat Mar 01 20:10:02 2008 +0100
     2.3 @@ -1,5 +1,11 @@
     2.4  # example program for baum
     2.5  # http://prog.marmaro.de/baum
     2.6 +#
     2.7 +# asks the user to input 3 numbers
     2.8 +# then prints the sum of them
     2.9 +# and returns the sum to the shell
    2.10 +#
    2.11 +# Attention: expect number overflow!
    2.12  
    2.13  print(0)
    2.14  	sum(0)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/examples/sum3input_v2.baum	Sat Mar 01 20:10:02 2008 +0100
     3.3 @@ -0,0 +1,17 @@
     3.4 +# example program for baum
     3.5 +# http://prog.marmaro.de/baum
     3.6 +#
     3.7 +# echoes the sum and a newline afterwards
     3.8 +# then returns 0 to the shell
     3.9 +#
    3.10 +# see: sum3input.baum
    3.11 +
    3.12 +number(0)
    3.13 +	sum(0)
    3.14 +		print(0)
    3.15 +			sum(0)
    3.16 +				input(0)
    3.17 +				input(0)
    3.18 +				input(0)
    3.19 +		print(99)
    3.20 +			number(10)