about this book

Graphing calculator programming is a rewarding way to get started in computer programming, to develop your existing skills, or just to have fun with the challenge of working with such a device. If you’re a student or teacher, especially of math or science, the programs you write for your calculator can speed up annoying, repetitive calculations or help you check your work. You can enjoy the feeling of accomplishment from completing a useful utility or a fast-paced game for your calculator.

From this book, you’ll learn everything you need to know to progress from a non-programmer to a TI-BASIC pro. If you have programming experience, or even TI-BASIC skills, it will teach you advanced tricks and hopefully help you see the language in a new way. The problem-solving skills in each chapter can be applied to almost any programming language that you might encounter.

If you’re a beginner, I recommend that you read this book front to back, starting from the first chapter and working your way to the end. If you have some experience or are looking for answers to specific questions, you can skip to the relevant chapter. I assume beginning in chapter 2 that every reader has the same basic set of calculator skills and knows how to perform math, draw graphs, and use lists and matrices. If you’re uncomfortable with any of those concepts, I strongly recommend that you read through appendix A before you get to chapter 2. In case you forget the syntax for any TI-BASIC command that you learn, you can look at appendix B, which is arranged to parallel the organization of the chapters. No programmer should have to code in a vacuum, so when you get stuck, be sure to visit the Author Online forum, Cemetech, or any of the other forums and websites listed in appendix C.

Throughout this book, you’ll look at both educational and fun programs that test each new idea and cobble it together with the things that you’ve already learned. In many places, I’ll talk about some program that you might want to write but don’t yet know how to create and then introduce new concepts that will provide those skills.

Roadmap

This book consists of 13 chapters, divided into three parts. It also has three appendixes, which summarize skills, commands, and resources that any calculator programmer might need. Part 1 focuses on introducing programming skills that are important for TI-BASIC programming but apply to almost any language you might want to learn.

Part 2 takes the basic framework from part 1 and teaches additional commands and features necessary for more professional and complete programs. These include graphics, interactivity, and the proper use of the many data types your calculator understands, such as matrices, lists, strings, and pictures.

Part 3 goes into advanced concepts and may be particularly engaging even if you have prior TI-BASIC or programming experience. It covers optimization, hybrid BASIC, and the rudiments of assembly.

The appendixes provide a quick reference to material supplementing and coalescing the contents of the chapters:

Who should read this book

Who are you? You might be a student who is getting a graphing calculator for the first time or recently started using one and wants to unlock your device’s full potential. Perhaps you are a teacher, an engineer, a programmer, or just curious. If you’ve never before programmed anything, you have a whole world of amazing things that programming can enable you to do and learn in front of you, and I’ll be honored to guide you forward. This book is primarily aimed at you, the budding programmer. I’ll lead you through graphing calculator programming, but I’ll also help you keep an eye on programming in general and teach you concepts you can apply to almost any language.

If you’ve toyed with programming before, for calculators, computers, or another platform, I hope this book can teach you how to learn more, to write and understand complete programs, and to have fun doing so. If you’re an advanced programmer, either for calculators or something else, I want to provide you with a great reference guide for calculator programming, advanced topics and optimization tricks, perhaps get you interested in z80 assembly programming, and give you another perspective on programming as a hobby and as a career.

I’ll teach you everything you need to know to write complete programs for your graphing calculator (and everyone else’s); I assume that you have no prior knowledge of calculator programming or any sort of programming. I’ll teach you how to think like a programmer and how to apply problem-solving skills to take any program you might want to write, break it down into pieces, and code each one. If you have some prior programming skill, great; if you have previous graphing calculator programming skill, all the better. The chapters ahead are designed to teach you everything you need to know, from the basics up to the most advanced tricks for creating very fast, very small, very fancy programs. If you have some experience, you may end up skimming sections, but even if you feel like you know your way around a simple TI-BASIC program, you’re likely to run across new tricks and features that you hadn’t previously played with.

Why write calculator programs; why not just jump straight to programming a computer? The short answer: the opportunity to learn quickly, have fun, surmount the challenges of a programming platform, and get started right away. If you’re reading this book, chances are you already have a graphing calculator. If you don’t, then you can get one for less than $100. The TI-83+, TI-83+ Silver Edition, TI-84+, and TI-84+ Silver Edition covered in this book are all cheap, widely available, and widely owned graphing calculators and can all run each other’s programs. The TI-83 can run very similar programs and is similarly inexpensive and ubiquitous. Although their programming languages are somewhat different, many of the same skills can be applied to programming other TI graphing calculators and to Casio calculators such as the color-screen Casio Prizm. Calculators are small and portable, great to carry around and whip out when you have some downtime to work on your programming but don’t have or want to carry around a laptop. They last for months, not a few hours, on a single charge or set of batteries.

Typographic conventions and code

Looking at code examples as you learn is vital to a full understanding of a language. Examples large and small, along with occasional exercises, are scattered far and wide through this text. Full programs are often presented in listings, though shorter programs may be interspersed between paragraphs in monospaced font. Several other conventions are followed:

The code for all of the programs presented in this book can be found on the publisher’s website, www.manning.com/ProgrammingtheTI-83Plus/TI-84Plus. Each program can be tested on your calculator or emulator; a list of the top TI calculator emulation software packages is included in appendix C. You can also view the source of programs on your computer using SourceCoder, at http://sc.cemetech.net.

All screenshots in this book were taken with the Wabbitemu or jsTIfied emulators and adjusted and annotated in GIMP. All source code listings were generated from the original programs by SourceCoder or written in that IDE and checked in an emulator.

Online resources

The purchase of Programming the TI-83 Plus/TI-84 Plus includes free access to a private web forum run by Manning Publications, where you can make comments about this book, ask technical questions, and receive help from both the author and from other readers. The Author Online forum can be found at www.manning.com/ProgrammingtheTI-83Plus/TI-84Plus. This page contains information on how to register on and use the forum, what kind of help is available, and the rules of conduct.

Manning’s commitment to our readers is to provide a venue where a meaningful dialogue between individual readers and between readers and the author can take place. It’s not a commitment to any specific amount of participation on the part of the author, whose contribution to the forum remains voluntary (and unpaid). We suggest you try asking the author some challenging questions lest his interest stray!

The Author Online forum and the archives of previous discussions will be accessible from the publisher’s website as long as the book is in print.

You can also ask technical questions on the author’s forum, Cemetech, which has a special subforum for this book at www.cemetech.net/forum/f/70 (or http://cemete.ch/f70). Appendix C lists many more online resources, including places to download and publish programs, development tools, and emulators.

About the author

Christopher Mitchell is a graduate student of computer science and electrical engineering, a teacher, and a recognized leader in the TI and Casio graphing calculator programming communities. Christopher started programming Logo and QBasic when he was seven years old, taught himself TI-BASIC at the age of 13, and has since branched out into hardware and software development for many platforms. He is the graphing calculator community’s most prolific author, with well over 300 completed programs. Today, Christopher hosts discussions and collaboration on calculator programs and projects at his website, Cemetech. Christopher is proud to be a born-and-raised New Yorker. He has bachelor’s and master’s degrees in electrical engineering from Cooper Union and is now pursuing a PhD in computer science at the Courant Institute of NYU.

About the title

While we refer to the calculator by its shortened name TI-83+/TI-84+ throughout the book in order to save space and avoid repetition, the official name of the calculator is TI-83 Plus/TI-84 Plus and we do use this name written out in full in the title and in other official references to the book or the calculator.

About the cover

Manning has a tradition of using illustrations from 18th- and 19th-century collections of regional dress customs on their covers. After feedback from many students in this book’s target audience, however, an alternative was created for this book, combining classical art with the instantly recognizable outline of a TI-83+ graphing calculator. The final design on the cover of this book, refined through many creative iterations, is inspired by Leonardo da Vinci’s “Vitruvian Man,” in which the human figure is replaced with calculators.