Terminal control/Cursor movement: Difference between revisions
m
→{{header|Forth}}: fixed </LANG> tag
(Added solution for Action!) |
m (→{{header|Forth}}: fixed </LANG> tag) |
||
Line 665:
The following example assumes we are using a terminal that accepts ANSI escape codes. It defines the ANSI codes as Forth words with a markup language look. With this code compiled into the Forth system, the commands are used like native Forth commands.
<
DECIMAL
Line 688:
( Define ANSI Forth names for these functions using our markup words)
: AT-XY ( col row -- ) SWAP <CUP> ;
: PAGE ( -- ) <ED> 1 1 <CUP> ;</
Rosetta Task
<lang forth>( move the cursor one position to the left) 1 <CUB>
Line 698:
( move the cursor to the top left corner of the screen) 1 1 <CUP>
( move the cursor to the bottom right corner of the screen) 80 24 <CUP>
</
=={{header|Go}}==
|