aboutsummaryrefslogtreecommitdiff
path: root/test.uwu
blob: 6182a05cc3c75bb1878f905c0c5727c7f9e50117 (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
41
42
43
44
45
46
47
48
49
50
51
52
main flow:linear(
	io:print("please enter something:"),
	io:print(io:scan),

	io:print(:str:cat(
		"your input: ",
		io:scan("please enter something else: ")
	)),

	io:print(:nil:nil),
	fs:write("test", "hello world"),
	:bool:if(fs:exists("test"),
		io:print("successfully wrote file"),
		flow:error("failed to write file")
	),

	io:print(fs:read("test")),

	fs:remove("test"),
	:bool:if(fs:exists("test"),
		flow:error("failed to remove file"),
		io:print("successfully removed file")
	),

	io:print(:nil:nil),
	io:print(os:time),
	os:sleep(500),
	io:print(os:time),

	io:print(:nil:nil),
	os:execute("echo hello world"),

	io:print(:nil:nil),
	io:print(:str:cat(
		"Unseeded dice: ",
		random:random(1, 6)
	)),

	random:seed(os:time),
	io:print(:str:cat(
		"Seeded dice: ",
		random:random(1, 6)
	)),

	io:print(:str:cat(
		"RAND_MAX = ",
		random:max
	)),

	io:print(:nil:nil),
	"success"
)