preface

When I was 13 years old, I received my first graphing calculator. It was Christmas, and my biggest present under the tree was a TI-83. I was thrilled. I first used it just for math, but over several months, I became more curious and discovered that I could write programs directly on the calculator. The guidebook included with the calculator didn’t really help with programming, other than demonstrating an interesting Sierpinski Triangle. Undeterred, I set off to teach myself calculator programming, although I never thought of it in such definite terms.

I first learned to display text on the screen and then to make simple animations. I discovered that I could also ask the user for input and thus make simple math programs to check my homework results. Soon classmates began passing around arcade games they had found for their calculators, so I dug into the source code for those games and found out how they worked, using my new skills to create games of my own. Over the years I grew more competent, including learning to write z80 assembly, a more complex but much more powerful language than TI-BASIC. I started an online community around graphing calculator programming called Cemetech (pronounced “KEH-meh-tek”) that thrives as a hardware and software development haven to this day. I continued to pursue programming as well as my lifelong love of hardware and electronics. I earned two degrees in electrical engineering and one in computer science; I’m now working toward my doctorate. I credit much of my love of programming and engineering to those first faltering steps with my graphing calculator.

Having helped new calculator programmers to learn the tricks of the trade for close to 13 years on Cemetech’s forum, I’ve heard countless variations on my story. I’ve worked with students who got a calculator and started to play with its math features, only to discover it was programmable. I’ve helped others who downloaded games from their peers, then took the games apart to see what made them tick. I’ve seen like-minded students form small programming groups to make math programs and games for their friends. Many of these students are now in college or graduate school, studying engineering or computer science; others work in the industry as professional programmers or as teachers and professors. Almost all of them credit their first forays into calculator coding for their current love of technology and programming.

When I show off my latest projects, there’s bound to be at least one person who asks, “why?” Why would I bother working with such a low-powered, primitive device, when I have the equipment and skills to write more complex software for vastly more capable systems? The answer is that I love the utility of graphing calculators as an introductory programming platform and I love a challenge. When I’m writing a TI-83+ program, every byte of the calculator’s 24 K of RAM is important, and every cycle of its 6 MHz processor must be carefully rationed.

When I wear my other hats as an electrical engineer, a computer scientist, a webmaster, and a researcher, I work with systems that have many more capabilities. These systems provide their own performance and design challenges, but none are quite as simultaneously simple and complex as graphing calculators. From a teaching perspective, I believe calculators are an accessible platform on which to learn the problem-solving skills vital to becoming a good programmer. You can write and test code directly on a device that many students already own, and, with only the capabilities built into your $100 calculator, create surprisingly complex projects. In a very real sense, you’re working with a full-fledged if slightly antiquated computer.

These dual attractions of graphing calculator programming have driven me to continue to pursue my own calculator projects and to build a community of like-minded coders and teachers. Throughout the years, I’ve sporadically hoped to document my extensive calculator programming experience in some way. In 2003, I wrote a rudimentary TI-BASIC tutorial. Two years later, I wrote and published a guide to advanced TI-BASIC optimizations with a fellow Cemetech administrator, which 14,000 coders have read to date. Between 2005 and 2006, I attempted to motivate the community to document their TI-BASIC knowledge in a wiki, a project that never gained much traction, but I continued to wish there was a way to write an exhaustive, thorough guide to TI-BASIC programming.

So it was with excitement that I received Manning’s request that I write a book about graphing calculator programming. I’ve tried to transcribe as many of the lessons that I learned over the years onto these pages, from basic lessons to advanced tips and tricks. I’ve found that calculator programming has helped me to think more critically as a programmer and as an engineer and made it easier for me to pick up other languages. I’ve tried to pass along many of the general problem-solving lessons I’ve accumulated in these pages, and I hope that regardless of whether you are learning calculator programming as its own goal or as a stepping-stone toward another language, you’ll have as much fun reading the coming chapters as I had writing them.

Any good programmer, engineer, or scientist knows that there’s always more to learn, so I hope to hear from many of you and find out what role calculators played in your life and how this book helped you. Perhaps you’ll show off some tips and projects of your own on Cemetech or in the larger programming community. I hope in the future to continue to help you with your programming, through other books, Cemetech, or indirectly through the rest of the programming community.

Good luck, and enjoy!