File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,13 +41,14 @@ This simple program covers many of the principal aspects of the `term ` module.
4141
4242## API
4343
44- Here are some functions you should be aware of in the ` term ` module:
44+ Here are some of the main functions of the ` term ` module:
4545
46- ``` v oksyntax
46+ ``` v
4747import term
4848
4949// returns the height and the width of the terminal
5050width, height := term.get_terminal_size()
51+ println('width: ${width}, height: ${height}')
5152// returns the string as green text to be printed on stdout
5253term.ok_message('cool')
5354// returns the string as red text to be printed on stdout
@@ -77,15 +78,15 @@ term.bg_green('field')
7778// sets the position of the cursor at a given place in the terminal
7879term.set_cursor_position(x: 5, y: 10)
7980// moves the cursor up
80- term.cursor_up()
81+ term.cursor_up(1 )
8182// moves the cursor down
82- term.cursor_down()
83+ term.cursor_down(1 )
8384// moves the cursor to the right
84- term.cursor_forward()
85+ term.cursor_forward(2 )
8586// moves the cursor to the left
86- term.cursor_back()
87- // shows the cursor
88- term.show_cursor()
87+ term.cursor_back(2)
8988// hides the cursor
9089term.hide_cursor()
90+ // shows the cursor
91+ term.show_cursor()
9192```
You can’t perform that action at this time.
0 commit comments