X-Git-Url: http://git.harvie.cz/?a=blobdiff_plain;f=demos%2Fboolean.c;h=77d1967d16ba7bbc9d6f943c7ca119526a27dfa0;hb=61ad8a2bf9aa7260d047255ed2bc0d79c67b8078;hp=1b5f1e2293e946a8018ab8146ff0b124a630a767;hpb=420bb7716ee099d369582836ef4fc8ab25d81fde;p=svn%2FCll1h%2F.git diff --git a/demos/boolean.c b/demos/boolean.c index 1b5f1e2..77d1967 100644 --- a/demos/boolean.c +++ b/demos/boolean.c @@ -2,10 +2,21 @@ program { - boolean t=TRUE,f=FALSE; + const bool t = TRUE, f = FALSE; + bool l, m = MAYBE; + str s; - print("TRUE and FALSE = ", bool_str(t and f) ); - print("TRUE or FALSE = ", bool_str(t or f) ); - print("not FALSE = ", bool_str(not f) ); - print("not TRUE = ", bool_str(not t) ); + 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); + } }