forked from solstice/solstice
(BREAKING) "use" keyword, stdlib seperate
This commit is contained in:
15
libs/conversions.sols
Normal file
15
libs/conversions.sols
Normal file
@@ -0,0 +1,15 @@
|
||||
def stringToInt(string in) int {
|
||||
result = 0
|
||||
ground {
|
||||
stoi $in &result
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
def intToString(int in) string {
|
||||
result = ""
|
||||
ground {
|
||||
tostring $in &result
|
||||
}
|
||||
return result
|
||||
}
|
||||
23
libs/io.sols
Normal file
23
libs/io.sols
Normal file
@@ -0,0 +1,23 @@
|
||||
def input(string msg) string {
|
||||
retval = ""
|
||||
ground {
|
||||
print $msg
|
||||
input &retval
|
||||
}
|
||||
return retval
|
||||
}
|
||||
|
||||
def print(string msg) string {
|
||||
ground {
|
||||
print $msg
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
def println(string msg) string {
|
||||
ground {
|
||||
println $msg
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user