Terminal control/Cursor movement: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(2 intermediate revisions by 2 users not shown)
Line 699:
( move the cursor to the bottom right corner of the screen) 80 24 <CUP>
</syntaxhighlight>
 
=={{header|FreeBASIC}}==
<syntaxhighlight lang="vb">Dim As Integer w, h
 
Screeninfo w, h
'move left
Locate , Pos(0) - 1
'move right
Locate , Pos(0) + 1
'move up
Locate Csrlin - 1
'move down
Locate Csrlin + 1
'beginning of line
Locate , 1
'end of line
Locate , h
'top left corner
Locate 1, 1
'bottom right corner
Locate w, h</syntaxhighlight>
 
=={{header|Go}}==
Line 1,229 ⟶ 1,250:
/*stick a fork in it, we're done.*/</syntaxhighlight>
 
=={{header|Ruby}}==
{{Works with|Ubuntu|22.04}}
<syntaxhighlight lang="ruby">require 'io/console'
 
def c (method, *args) # to avoid repeating sleeps
STDOUT.send(method, *args)
sleep 1
end
 
x, y = STDOUT.winsize
c(:clear_screen)
c(:cursor_right, 1)
c(:cursor_down, 1)
c(:cursor_left, 1)
c(:cursor_up, 1)
c(:goto_column, y)
c(:goto_column, 0)
c(:goto, 0, y)
c(:goto, x, 0)
</syntaxhighlight>
=={{header|Scala}}==
{{Works with|Ubuntu|14.04}}
Line 1,289 ⟶ 1,330:
 
=={{header|Wren}}==
<syntaxhighlight lang="ecmascriptwren">import "timer" for Timer
import "io" for Stdout
 
9,479

edits