You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,6 +85,27 @@ Run this once after unpacking, and macOS will stop treating the binary as “fro
85
85
86
86
-**`SLEEP`**: pause execution for a number of 60 Hz “ticks” (e.g., `SLEEP 60` ≈ 1 second).
87
87
88
+
### Screen coordinates and cursor positioning
89
+
90
+
-**Coordinate system**:
91
+
-`LOCATE col, row` and `TEXTAT col, row, text` both use **0‑based** screen coordinates, where `0,0` is the top‑left corner.
92
+
- Internally these are mapped to ANSI escape sequences as `ESC[row+1;col+1H`.
93
+
-**`LOCATE`**:
94
+
- Moves the cursor without printing: e.g. `LOCATE 10,5` positions the cursor at column 10, row 5 before the next `PRINT`.
95
+
-**`TEXTAT`**:
96
+
-`TEXTAT x, y, text` moves the cursor to `(x, y)` and writes `text` directly at that absolute position.
97
+
-`text` is any string expression, for example: `TEXTAT 0, 0, "SCORE: " + STR$(S)`.
98
+
-**Keeping final text visible**:
99
+
- Terminals often print the shell prompt immediately after your program exits; if your last output is on the bottom row, an implicit newline or prompt can scroll it off‑screen.
100
+
- To make sure your final UI remains visible, **explicitly position the cursor after your last `TEXTAT`/`LOCATE` output**, for example:
101
+
102
+
```basic
103
+
LOCATE 0, 22
104
+
PRINT "PRESS ANY KEY TO CONTINUE";
105
+
```
106
+
107
+
- This ensures the cursor (and thus any following prompt) appears where you expect, rather than accidentally pushing your last line out of view.
0 commit comments