There isn’t space in this book to provide code listings for all exercises. The answers provided here are more along the lines of hints and suggestions, with some brief code snippets.
Code samples for the chapters in the book are available on the book’s companion website at www.coursePTR.com/downloads. Examples are provided, implemented in Lingo.
Exercise 1.1 To construct the
convertBase(NumberString, Basel, Base2) function, the easiest way to do this (although not the most efficient) is to create one function that converts the string from base 1 to a number, and then another that converts it from a number into base 2. You can use the functions in the text for this, but look at
fromBase() in floats.