X-Git-Url: https://ocean-lang.org/code/?a=blobdiff_plain;f=csrc%2Foceani-tests.mdc;h=d5e60b739236ab9417b19fa11e329d49e1032a22;hb=6f3c6db8d0e5c5bf244f9a101e72e5e498b5fb6d;hp=f5f097a1b4ac0a77c648552fb0f00658fa710084;hpb=89377f910b5d607fdcdb2d7152ca3a58668a3de0;p=ocean diff --git a/csrc/oceani-tests.mdc b/csrc/oceani-tests.mdc index f5f097a..d5e60b7 100644 --- a/csrc/oceani-tests.mdc +++ b/csrc/oceani-tests.mdc @@ -157,6 +157,16 @@ Now we need to test if/else and some different loops count = count + 1 print "error is ", target - guess * guess + for j:=0; then j = j+3 ; while j < 10: + if j != 0 and then 20 / j > 3: + print "20 /", j," =", 20 / j + else: + print "I won't calculate 20 /", j + pi ::= 3.1415926535897 + if 355/113 == pi or else +(pi - 355/113) < 0.001: + print "Close enough" + print "lower" if 355/113 < pi else "higher" + ###### output: cond_loop Success 1 2 4 8 16 32 64 @@ -165,6 +175,12 @@ Now we need to test if/else and some different loops 2 1.41422 3 1.41421 error is -4.51095e-12 + I won't calculate 20 / 0 + 20 / 3 = 6.66667 + 20 / 6 = 3.33333 + I won't calculate 20 / 9 + Close enough + higher ## Say Hello