even more advanced hello world
authorxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Thu, 24 Jan 2008 15:36:50 +0000 (15:36 +0000)
committerxchaos <xchaos@4bb87942-c103-4e5a-b51c-0ebff58f8515>
Thu, 24 Jan 2008 15:36:50 +0000 (15:36 +0000)
git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@38 4bb87942-c103-4e5a-b51c-0ebff58f8515

cll1.h
demos/advanced-hello-world.c

diff --git a/cll1.h b/cll1.h
index 4dc23e16256b87fee09e2e2df7affd85ff917463..e3911e1621c8703836381af18d6c266a4875ec55 100644 (file)
--- a/cll1.h
+++ b/cll1.h
@@ -46,7 +46,7 @@
 #define or ||
 #define TRUE 1
 #define FALSE 0
-#define MAYBE (int)((_srtime?0:(time(&_srtime),srandom(_srtime))),random()%2)
+#define MAYBE (int)((_srtime?random():(_srtime=time(NULL),srandom(_srtime),random()))%2)
 #define WHOKNOWS (int)(srandom(time(NULL)),random()%2)
 #define bool_str(I) (I?"TRUE":"FALSE")
 #define boolean int
index 0c166659e4eefe610f379ae802ef95b5d622be32..e855e5e9d2894a8a29bf38d287dc9fe800ea7ebb 100644 (file)
@@ -5,5 +5,6 @@ program
  echo("Hello ",NULL," ","world","  ! ");
  print("Hello", "world",NULL,"!");
  
- print(MAYBE ? "Hello" : "Hi", WHOKNOWS ? "world" : "friend", MAYBE ? "!" : "?");
+ repeat(4) print((MAYBE ? "Hello" : "Hi"), (MAYBE ? "world" : "friend"), (MAYBE ? "!" : "?"));
+ repeat(4) print((WHOKNOWS ? "Hello" : "Hi"), (WHOKNOWS ? "world" : "friend"), (WHOKNOWS ? "!" : "?"));
 }
This page took 0.172465 seconds and 4 git commands to generate.