From 61d3a5a2d4d2919b30e1c268c3d4166d8f375972 Mon Sep 17 00:00:00 2001 From: ja Date: Thu, 23 Apr 2026 05:07:34 +0000 Subject: files --- main.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 67159ba..fcbafce 100644 --- a/main.c +++ b/main.c @@ -1,8 +1,40 @@ #include +extern int voodoo(); /* from vd.hc */ +extern void godword(); /* from gw.hc */ + int main(void) { - puts("Hello, world!"); + int t; + int f; + int g; + + t = voodoo(1); + f = voodoo(0); + g = voodoo(4); + + puts("voodoo() is a HolyC function."); + puts("If we pass 1 to it, it should return 0."); + puts("If we pass 0 to it, it should return 1."); + puts("For any other value, it should return 69."); + + puts("Tests:"); + + printf("pass 1, want 0 --> t = %d\n", t); + printf("pass 0, want 1 --> f = %d\n", f); + + printf("pass 4, want 69 --> g = %d\n", g); + + puts(""); + puts("Is this divine intellect?"); + puts(""); + + puts("Now let's try printing to stdout."); + puts("We are going to call godword(), a void-returning function."); + puts("If this works correctly, it should say something biblical:"); + + godword(); + return 0; } -- cgit 1.4.1