]> git.lizzy.rs Git - uwu-nolambda.git/blob - test.uwu
6182a05cc3c75bb1878f905c0c5727c7f9e50117
[uwu-nolambda.git] / test.uwu
1 main flow:linear(
2         io:print("please enter something:"),
3         io:print(io:scan),
4
5         io:print(:str:cat(
6                 "your input: ",
7                 io:scan("please enter something else: ")
8         )),
9
10         io:print(:nil:nil),
11         fs:write("test", "hello world"),
12         :bool:if(fs:exists("test"),
13                 io:print("successfully wrote file"),
14                 flow:error("failed to write file")
15         ),
16
17         io:print(fs:read("test")),
18
19         fs:remove("test"),
20         :bool:if(fs:exists("test"),
21                 flow:error("failed to remove file"),
22                 io:print("successfully removed file")
23         ),
24
25         io:print(:nil:nil),
26         io:print(os:time),
27         os:sleep(500),
28         io:print(os:time),
29
30         io:print(:nil:nil),
31         os:execute("echo hello world"),
32
33         io:print(:nil:nil),
34         io:print(:str:cat(
35                 "Unseeded dice: ",
36                 random:random(1, 6)
37         )),
38
39         random:seed(os:time),
40         io:print(:str:cat(
41                 "Seeded dice: ",
42                 random:random(1, 6)
43         )),
44
45         io:print(:str:cat(
46                 "RAND_MAX = ",
47                 random:max
48         )),
49
50         io:print(:nil:nil),
51         "success"
52 )