Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview

Buy Now



Karel the REALbasic Robot

How the rbKarel robot simulation teaches logic with RBScript

Issue: 8.1 (November/December 2009)
Author: Andy Dent
Article Description: No description available.
Article Length (in bytes): 22,739
Starting Page Number: 30
RBD Number: 8110
Resource File(s):

Download Icon project8110.zip Updated: Monday, November 2, 2009 at 11:57 AM

Related Web Link(s):


Known Limitations: None

Excerpt of article text...

Karel the Robot has been around for nearly thirty years as a way to teach people the basics of logic through solving simple problems. The rbKarel project uses RBScript to provide the language interpreter for Karel along with a few goodies like spoken output and single-stepping. It also uses a much simpler context object for a second RBScript to define worlds. Why write a parser when RBScript does the hard work for you? This article doesn't attempt to teach the basics of RBScript -- see the resources list at the end for past RBDeveloper articles on that topic. What I do cover are some of the interesting challenges in adapting RBScript for Karel and particularly how to add single-stepping and other controls over the script execution. As I wrote the article I also found myself explaining a few points about the software design decisions, which may seem heavy-handed to experienced programmers but hopefully will keep reminding others of some core principles.

When Jeff Ayling posted his request for help, I was intrigued by the "Just how hard could it be?" prospect of trying to implement a particularly REALbasic style of Karel.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.




Weblog Commenting and Trackback by HaloScan.com