Terminal control/Cursor movement: Difference between revisions
Content added Content deleted
Line 380: | Line 380: | ||
: <CUB> ( col --) ESC[ <##> ." D" ; |
: <CUB> ( col --) ESC[ <##> ." D" ; |
||
: <CPL> ( -- ) ESC[ ." F" ; |
: <CPL> ( -- ) ESC[ ." F" ; |
||
: <CHA> ( n --) ESC[ <##> ." G" ; |
|||
: <EL> ( -- ) ESC[ ." K" ; |
: <EL> ( -- ) ESC[ ." K" ; |
||
: <ED> ( -- ) ESC[ ." 2J" ; |
: <ED> ( -- ) ESC[ ." 2J" ; |
||
Line 387: | Line 388: | ||
: AT-XY ( col row -- ) SWAP <CUP> ; |
: AT-XY ( col row -- ) SWAP <CUP> ; |
||
: PAGE ( -- ) <ED> 1 1 <CUP> ;</LANG> |
: PAGE ( -- ) <ED> 1 1 <CUP> ;</LANG> |
||
Rosetta Task |
|||
<lang forth> |
|||
( move the cursor one position to the left) 1 <CUB> |
|||
( move the cursor one position to the right) 1 <CUF> |
|||
( move the cursor up one line ) 1 <CUU> |
|||
( move the cursor down one line) 1 <CUD> |
|||
( move the cursor to the beginning of the line) 1 <CHA> |
|||
( move the cursor to the end of the line ) 80 <CHA> |
|||
( 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}}== |
=={{header|Go}}== |