Updated smnp.io (markdown)
38
smnp.io.md
38
smnp.io.md
@@ -1,3 +1,41 @@
|
|||||||
# Functions
|
# Functions
|
||||||
|
## `print(...items)`
|
||||||
|
Prints the string representation of given items to standard output.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
```
|
||||||
|
print("a");
|
||||||
|
print("b");
|
||||||
|
print("c");
|
||||||
|
|
||||||
|
# Output:
|
||||||
|
# abc
|
||||||
|
```
|
||||||
|
|
||||||
## `println(...items)`
|
## `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(prompt: string = "")`
|
## `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!
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user