CommodoreSam returns with another educational session in his 6502 programming series, this time focusing on the Prog8 Guessing Game Tutorial. This episode moves beyond the simple “Hello World” demonstration to show a complete program conversion from BASIC to Prog8, using a classic number guessing game from the Commodore 64 User’s Guide.
Converting BASIC to Prog8
In the Prog8 Guessing Game Tutorial, Andrew walks through the process of cloning a GitHub repository containing both the BASIC and Prog8 versions of the game. He explains how Prog8’s modular structure differs from BASIC’s line-numbered format and emphasizes the language’s use of static variables, explicit data types, and structured loops. The demonstration highlights how a simple guessing game can teach essential programming principles while reinforcing 6502-based logic.
Exploring Variables and Structure
Andrew explains the variable types available in Prog8, including ubite, word, and bool, and how each affects memory usage on the Commodore 64. He also illustrates how to define loops, handle input and output, and create subroutines without the reliance on GOTO statements. The tutorial provides clear examples of translating logic from BASIC to modern structured programming concepts.
Adding Functionality and Libraries
The video demonstrates importing Prog8 modules for text I/O, math, and conversion functions. Viewers learn how to use library routines to handle random number generation and string-to-integer conversion, allowing the game to pick a number and interact with the player smoothly. Andrew even touches on mixing inline assembly with Prog8 for added performance, offering a glimpse into the language’s flexibility.
Looking Ahead
CommodoreSam closes the session by hinting at future topics, such as adding graphics or tackling a Tetris clone. The episode is a hands-on and informative guide for anyone looking to learn Prog8 programming through real examples on the Commodore 64.





