X-Git-Url: https://ocean-lang.org/code/?p=ocean;a=blobdiff_plain;f=csrc%2Foceani-tests.mdc;h=ab89bf27ccd52140f8b43a4a72c0ecf18d6d8ec0;hp=8e4ddadd7e9bb07b387929dd05a1434f7692b62f;hb=e74b53b80e4b2cdf846e9dd207180087e0b9c41b;hpb=7b1280e4a50fee191043436ebc8b2f8c482ccdaf diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index 8e4ddad..ab89bf2 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -242,6 +242,16 @@ Now we need to test if/else and some different loops print "Close enough" print "lower" if 355/113 < pi else "higher" + if pi > 3 then print "pi exceeds three"; else print "need more pie" + if (pi < 3) { print "not enough pi" } else { print "pi sufficient" } + for { i := 0; sum := 0 } + then { i = i+1 } + while i <= 10: + sum = sum + i + else: + pass + print "sum 1..10 is", sum + ###### output: cond_loop Success 1 2 4 8 16 32 64 @@ -256,6 +266,9 @@ Now we need to test if/else and some different loops I won't calculate 20 / 9 Close enough higher + pi exceeds three + pi sufficient + sum 1..10 is 55 ## Say Hello