repos / gbc

GBC - Go B Compiler
git clone https://github.com/xplshn/gbc.git

gbc / tests
xplshn  ·  2025-08-13

ternary.b

B
 1test(n) {
 2	extrn printf;
 3	printf(
 4		"%d:\t%s\n", n,
 5		n == 69 ? "69" :
 6		n == 420 ? "420" :
 7		n < 69 ? "..69" :
 8		n >= 420 ?
 9			n >= 1337 & n != 1337 ? "1337.." :
10	   "420..=1337" :
11		"69..420"
12	);
13}
14main(argc, argv) {
15	test(0);
16	test(42);
17	test(69);
18	test(96);
19	test(420);
20	test(690);
21	test(1337);
22	test(4269);
23}