5
smnp.io
Bartłomiej Przemysław Pluta edited this page 2020-04-02 09:15:09 +02:00

Functions

print

print(...items)

Prints the string representation of given items to standard output.

Example

print("a"); 
print("b"); 
print("c");

# Output:
# abc

println

println(...items)

The same as print(...) however ends each line new line character (\n).

Example

println("a"); 
println("b"); 
println("c");

# Output:
# a
# b
# c

read

read(prompt: string = "")

Reads an input from user as a string. The optional parameter is the prompt displayed on the standard output.

Example

name = read("Provide your name: ");
println("Hello, " + name + "!");

# Output:
# Provide your name: [Bartek]
# Hello, Bartek!