-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest2.L
More file actions
30 lines (24 loc) · 874 Bytes
/
Copy pathtest2.L
File metadata and controls
30 lines (24 loc) · 874 Bytes
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
{
# My giga scuffed standard library LULE #
_:;x;{x} # identity function since we can't use parenthesis in expressions #
printDigit: ;num; print(48+num)
newline: ;; print(10)
if: ;bool action; bool & action()
!: ;bool; bool < 1
# stdlib end #
# Takes a predicate acting on the loop count, and an action acting on the loop count to perform while the predicate evaluates true #
loop: ;predicate action; {
recusiveHelper: ;count; {
action(count)
if(predicate(count + 1) ;; { recusiveHelper(count + 1) } )
}
if(predicate(0) ;; { recusiveHelper(0) } )
}
# Prints the numbers 0 - 9 #
loop(;i;i<10 ;i;printDigit(i) )
newline()
add: ;x; ;y; y + x
addFour: add(4)
if (addFour(5) = 9 ;; { print(80) print(111) print(103) newline() }) # Pog #
0
}