skip to main content
Skip header Section
Realm of Racket: Learn to Program, One Game at a Time!June 2013
Publisher:
  • No Starch Press
  • 401 China Basin Street Suite 108 San Francisco, CA
  • United States
ISBN:978-1-59327-491-7
Published:25 June 2013
Pages:
312
Skip Bibliometrics Section
Bibliometrics
Skip Abstract Section
Abstract

Racket is a descendant of Lisp, a programming language renowned for its elegance, power, and challenging learning curve. But while Racket retains the functional goodness of Lisp, it was designed with beginning programmers in mind. Realm of Racket is your introduction to the Racket language.In Realm of Racket, you'll learn to program by creating increasingly complex games. Your journey begins with the Guess My Number game and coverage of some basic Racket etiquette. Next you'll dig into syntax and semantics, lists, structures, and conditionals, and learn to work with recursion and the GUI as you build the Robot Snake game. After that it's on to lambda and mutant structs (and an Orc Battle), and fancy loops and the Dice of Doom. Finally, you'll explore laziness, AI, distributed games, and the Hungry Henry game.As you progress through the games, chapter checkpoints and challenges help reinforce what you've learned. Offbeat comics keep things fun along the way.As you travel through the Racket realm, you'll: Master the quirks of Racket's syntax and semantics Learn to write concise and elegant functional programs Create a graphical user interface using the 2htdp/image library Create a server to handle true multiplayer gamesRealm of Racket is a lighthearted guide to some serious programming. Read it to see why Racketeers have so much fun!

Contributors
  • Northeastern University

Recommendations

Reviews

Julia Yousefi

Following the style of Conrad Barski's Land of Lisp [1], the authors of this book use games to teach the concepts of the programming language Racket, which is a descendant of Lisp. Comics interleaved with the chapters lend a lighthearted tone to the subject matter. Each chapter helps the main character, Chad, work his way through Dr. Racket's domain, so that by the end of the book, Chad (and, hence, the reader) is ready to dive deeper into programming with Racket. While the intended audience is the novice programmer, this textbook is useful for anyone who would like an introduction to the Lisp family of programs. The introduction tells how Racket was derived from Scheme as a way to teach math in a creative way to middle and high school students. The authors note that the developers include "structures, class systems, exceptions, ? libraries for graphical user interfaces and many other things" to make the language robust enough to develop the systems that students can use to create their games. There is a logical progression of material covered in each chapter, and each chapter builds on the previous one. Readers are encouraged to download the "drRacket" programming development environment (PDE) to try out the programs as they read the book. Chapter 1 presents an overview and instructions on using the PDE. Games are included throughout the book to illustrate the concepts described in each chapter. The first game, "Guess My Number," introduces readers to the program structure in chapter 2. The next three chapters present syntax, semantics, variables, lists, structures, conditions, decisions, and defines, with plenty of examples to try out. Finally, the graphical user interface library is introduced and "Guess My Number" is updated to use it. The next game, "Robot Snake," appears in chapter 6 to illustrate recursion as a list-eating function. It also serves to go deeper into the graphical user interface library for visual rendering. Before moving on to the next game, chapter 7 presents the concept of lambda. In the next chapter, the game is "Orc Battle." Chapter 8 delves deeper into structures and how they can be used to model the program domain (or world, as it is called here). The idea of functional programming is discussed in this chapter, along with how to enable structures to be mutable even when deeply embedded in lists. Constructor, accessor, and mutator functions are also presented. Before the next game is introduced, chapter 9 presents many flavors of for loops and how they can be used to process lists and combine the results in different ways. This short chapter is a must-read to understand the code in subsequent chapters. The next game, "Dice of Doom," is introduced in chapter 10 and further refined in chapters 11 and 12. This application makes use of a game tree. The first iteration of the program sets up a 2x2 playing field to demonstrate how the game tree works. Lazy evaluation, delayed computation, and memoization are introduced to optimize performance and allow larger playing fields. Finally, the artificial intelligence (AI) algorithm minimax is added to the game to allow the computer to play against a human. The final game, "Hungry Henry," is used to introduce the concept of distributed programming. Chapter 13 describes the basics and how to set up a server and clients, while chapter 14 follows up with the game implementation, which demonstrates the distributed programming strategy. To end the book, the very last chapter, "Good-Bye," discusses the idea of a meta-programming language and provides some examples of how Racket can be used in more advanced ways. Finally, Chad, our comic hero, has the whole realm of computer science to explore in a whole new way. Despite the fluff of comics and games, this is a textbook for serious learning. Readers are encouraged to experiment as they go along and to reference the documentation found in the drRacket PDE to learn more about Racket. While the authors have an earnest enthusiasm for Racket that makes the work appealing to read, expect to be challenged along the way. In summary, the book intends to teach the concepts of the programming language Racket in a fun way, appealing to novice programmers through the use of games and comics. It proves to be a good introduction to the Lisp family of programs. By the end of the book, the reader should have a good understanding of how to program in Racket. More reviews about this item: Amazon , Goodreads Online Computing Reviews Service

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.