]> git.lizzy.rs Git - uwu-nolambda.git/blobdiff - test.uwu
Fix typo in README.md
[uwu-nolambda.git] / test.uwu
index 8e7d32b52455ddce7ee3afb5697b93f9c3916320..e543bb4f4374766d9dfd3470c939cd84251d0525 100644 (file)
--- a/test.uwu
+++ b/test.uwu
@@ -1,37 +1,52 @@
-main flow:linear(
-       io:print("please enter something:"),
-       io:print(io:scan),
+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(str.cat(
+               "your input. ",
+               .io.scan("please enter something else: ")
        )),
 
-       io:print(:nil:nil),
-       io:print("--- QUINE ---"),
-       io:print(fs:read("test.uwu")),
-       io:print("--- END OF QUINE ---"),
-       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(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")),
+       .io.print(.fs.read("test")),
 
-       fs:remove("test"),
-       :bool:if(fs:exists("test"),
-               flow:error("failed to remove file"),
-               io:print("successfully removed file")
+       .fs.remove("test"),
+       bool.if(.fs.exists("test"),
+               .flow.error("failed to remove file"),
+               .io.print("successfully removed file")
        ),
 
-       io:print(os:time),
-       os:sleep(500),
-       io:print(os:time),
+       .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)
+       )),
 
-       os:execute("echo hello world"),
+       .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"
 )