From de48beef600fc5889f30b2094e392c1f5d8ed09a Mon Sep 17 00:00:00 2001 From: xchaos Date: Thu, 24 Jan 2008 15:36:50 +0000 Subject: [PATCH] even more advanced hello world git-svn-id: https://dev.arachne.cz/repos/cll1h/trunk@38 4bb87942-c103-4e5a-b51c-0ebff58f8515 --- cll1.h | 2 +- demos/advanced-hello-world.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cll1.h b/cll1.h index 4dc23e1..e3911e1 100644 --- 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 diff --git a/demos/advanced-hello-world.c b/demos/advanced-hello-world.c index 0c16665..e855e5e 100644 --- a/demos/advanced-hello-world.c +++ b/demos/advanced-hello-world.c @@ -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 ? "!" : "?")); } -- 2.30.2