summary refs log tree commit diff
path: root/main.c
blob: fcbafce007c35ede6f9394ceb951eba77cf0af98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <stdio.h>

extern int voodoo(); /* from vd.hc */
extern void godword(); /* from gw.hc */

int
main(void)
{
	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;
}