Writing Something Big
Everybody loves toys and games. Most people love “toy” games too. To conclude this chapter, you’ll develop a toy game called Hangman.[14] Honestly, it’s not a game (though it will be playable and even enjoyable) but a prototype—nothing fancy, just the core functionality. And you need to go over one more word set.
Terminal Control
Forth provides a tiny collection of words that control the terminal. You can use them to create rudimentary text-based user interfaces, including text-based games.
The first word in the set, PAGE ( -- ), clears the page and places the cursor in the upper-left corner.
The word FORM ( -- u1 u2 ) reports the height and width of the terminal (the number of rows and columns). Knowing these two ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access