-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.srm
More file actions
40 lines (39 loc) · 791 Bytes
/
example.srm
File metadata and controls
40 lines (39 loc) · 791 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
31
32
33
34
35
36
37
38
39
40
type adderFn = (int):int
let getAdder=(x:int):adderFn=>(y:int):int=>x+y
let x=(2+3)*6+2
let square=(x:int):int=>x*x
let doesComplexStuff=(x:int,y:int,z:int):int=>{
let n=square(x)+square(y)+square(z)
print(n)
n
}
let main=()=>{
while 0<x {
print(square(x))
if x<5 {
print("5 or less")
} else {
print(">5")
}
x=x-1
}
print(doesComplexStuff(4,2,7))
let y=4+3
print(y)
print("hello"+" "+"world")
let str="yes"
let str2="no"
print(str)
print(4+" apples")
print("Please enter your first name")
let firstName=getInput()
print("Please enter your last name")
let lastName=getInput()
print("Hello "+firstName+" "+lastName)
let union:int|string=5
print("union="+union)
union="yo"
print("union="+union)
let myAdder=getAdder(9)
print("myAdder(4)="+myAdder(4))
}