# HG changeset patch # User meillo@marmaro.de # Date 1204398602 -3600 # Node ID 96e2d58bc346abfec5038b4ad0f61ac0722afa67 # Parent ff01f0f076e4cffb12ff5de8db742694b0315e59 added new example program; added comments to example programs diff -r ff01f0f076e4 -r 96e2d58bc346 examples/helloworld.baum --- a/examples/helloworld.baum Sat Mar 01 20:04:08 2008 +0100 +++ b/examples/helloworld.baum Sat Mar 01 20:10:02 2008 +0100 @@ -1,5 +1,10 @@ # hello world program for baum # http://prog.marmaro.de/baum +# +# prints "Hello World" +# and returns the answer to everything +# +# ... what fabulous program :-) sum(0) print(99) @@ -27,3 +32,5 @@ number(100) #d print(99) number(10) #\n + + number(4) diff -r ff01f0f076e4 -r 96e2d58bc346 examples/sum3input.baum --- a/examples/sum3input.baum Sat Mar 01 20:04:08 2008 +0100 +++ b/examples/sum3input.baum Sat Mar 01 20:10:02 2008 +0100 @@ -1,5 +1,11 @@ # example program for baum # http://prog.marmaro.de/baum +# +# asks the user to input 3 numbers +# then prints the sum of them +# and returns the sum to the shell +# +# Attention: expect number overflow! print(0) sum(0) diff -r ff01f0f076e4 -r 96e2d58bc346 examples/sum3input_v2.baum --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/sum3input_v2.baum Sat Mar 01 20:10:02 2008 +0100 @@ -0,0 +1,17 @@ +# example program for baum +# http://prog.marmaro.de/baum +# +# echoes the sum and a newline afterwards +# then returns 0 to the shell +# +# see: sum3input.baum + +number(0) + sum(0) + print(0) + sum(0) + input(0) + input(0) + input(0) + print(99) + number(10)