io
This unit designed for console input and output.
List of constants
Name | Type | Description |
---|---|---|
kb | struct | Keyboard scancodes string |
color | struct | Console colors |
eol | string | Contains string |
Functions
1. io::clear
Clears console.
Type definition
func()
List of arguments
This function has no parameters
List of results
This function returns no results
2. io::color
Sets text and background color.
Type definition
func(text: int, back: int)
List of arguments
Name | Type | Description |
---|---|---|
text | int | Color of the text |
back | int | Color of the background |
List of results
This function returns no results
3. io::curPos
Returns cursor position.
Type definition
func(-> struct(x: int, y: int))
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | struct(x: int, y: int) | Cursor coords |
4. io::get
Reads text from console.
Type definition
func(-> string)
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | string | Text read from console |
5. io::goto
Moves cursor to a given coords.
Type definition
func(x: int, y: int)
List of arguments
Name | Type | Description |
---|---|---|
x | int | Desired column |
y | int | Desired row |
List of results
This function returns no results
6. io::key
Retruns first pressed key on keyboard.
Type definition
func(wait: bool -> int)
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | int | Key code |
7. io::pause
Waits till user strikes Enter key.
Type definition
func()
List of arguments
This function has no parameters
List of results
This function returns no results
8. io::put
Prints a text in console.
Type definition
func(value: string)
List of arguments
Name | Type | Description |
---|---|---|
value | string | Text to be printed |
List of results
This function returns no results
9. io::size
Returns console width and height.
Type definition
func(-> struct(width: int, height:int))
List of arguments
This function has no parameters
List of results
Name | Type | Description |
---|---|---|
- | struct(width: int, height:int) | Console width and height |