X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=demos%2Fboolean.c;h=ed44988b4d7d5294e3a85246f04e35fe69e915aa;hb=25a3f4304e39dce85a217fd3166df867a5d75b96;hp=aee578c514ecff1c3823044513809acf27ac65d1;hpb=547332b7650fec6dbcaf2053369fd9dc8c6af091;p=svn%2FCll1h%2F.git diff --git a/demos/boolean.c b/demos/boolean.c index aee578c..ed44988 100644 --- a/demos/boolean.c +++ b/demos/boolean.c @@ -2,13 +2,21 @@ program { - boolean t = TRUE, f = FALSE, m = MAYBE; + const bool t = TRUE, f = FALSE; + bool l, m = MAYBE; + def_str(s); - print("TRUE and FALSE = ", bool_str(t and f) ); - print("TRUE or FALSE = ", bool_str(t or f) ); - print("TRUE and MAYBE = ", bool_str(t and m) ); - print("FALSE or MAYBE = ", bool_str(t or m) ); - print("not FALSE = ", bool_str(not f) ); - print("not TRUE = ", bool_str(not t) ); - print("not MAYBE = ", bool_str(not m) ); + print("TRUE and FALSE =", btoa(t and f) ); + print("TRUE or FALSE =", btoa(t or f) ); + print("TRUE and MAYBE =", btoa(t and m) ); + print("FALSE or MAYBE =", btoa(t or m) ); + print("not FALSE =", btoa(not f) ); + print("not TRUE =", btoa(not t) ); + print("not MAYBE =", btoa(not m) ); + + for_strs(s, "TRUE","false","yes","NO","True","FALSE","YES","no","Yes","No","1","0","abc","xyz","Eyes","Ears","rue","alse","oui","no","ano","ne"," ","NULL",NULL,EOL,"","ano","ne") + { + l = atob(s); + echo("\"", s, "\"\tmeans ", btoa(l),EOL); + } }