Lesson 0 — Place a star
Status: In progress
Goal
Print a *
anywhere on the C64 screen using screen memory.
Concepts
- Clear screen:
PRINT CHR$(147)
- Screen size: 40 columns × 25 rows (X=0..39, Y=0..24)
- Screen base address:
1024
- Address of cell (X,Y):
1024 + Y*40 + X
- Place
*
(PETSCII 42):POKE 1024+Y*40+X,42
Open interactive sandbox for this lesson →
Try it (type this on a C64):
PRINT CHR$(147) X=10 : Y=5 POKE 1024+Y*40+X,42
Challenge
Ask the user for coordinates and place the star there:
INPUT "X (0-39)";X INPUT "Y (0-24)";Y PRINT CHR$(147) POKE 1024+Y*40+X,42