OS X games from the ground up: index

This index explains what you’ll learn in each part of OS X games from the ground up. It also includes download links for the starter files for each part of the project. This makes it easier for you to start, or restart, at a particular point without having to work through from the beginning. To start at any post other than the beginning, download the starter files from the link that is immediately before the post you want to start from.

First steps

  • Introduction
  • Source code for the first programme to be converted: BUZZWORD.BAS
  • Constructing a simple flowchart
  • Introduction to the C language
  • Introduction to Xcode
  • Creating a Command Line Tool in Xcode
  • The Xcode Project Navigator
  • Building and running the Hello World programme
  • The Xcode Debug pane

Starter files from end of First steps: first steps

Your first programme

  • Opening an existing project with Xcode
  • The printf function
  • Escape sequences
  • Terminating C statements with a semi-colon
  • The Xcode Log Navigator

Starter files from end of Your first programme: your first programme

Variables

  • What is a variable?
  • The C stack
  • Variable declarations
  • The int and float types
  • Format specifiers
  • The value of uninitialised variables
  • Initialising variables
  • Simple operators: addition, +, subtraction, -, multiplication, *,  and division, /
  • Operator precedence and order of associativity
  • Using parentheses in expressions
  • The char type
  • Introduction to arrays
  • Declaring an array of ints
  • Initialising an int element in an array
  • The numbering of array elements
  • Declaring and initialising an array of ints in a single statement
  • Declaring and initialising an array of chars
  • Referencing individual elements of a char array
  • Declaring and initialising a string
  • The null character
  • String and integer literals

Starter files from the end of Variables: variables

More fun with variables and arrays 

  • Naming variables
  • Declaring an array of strings
  • Initialising an array of strings
  • Introduction to pointers
  • The const keyword

Starter files from the end of More fun with variables and arrays: more fun with variables and arrays

Functions and random numbers

  • Introduction to functions
  • Introduction to function libraries
  • Including function libraries
  • rand() and RAND_MAX
  • Getting a random number within a particular range
  • Rules for variable names
  • Using return values from functions
  • Function arguments and functions without arguments
  • The modulus operator
  • What are pseudo-random numbers?
  • The srand function
  • The time function
  • Using the date and time to seed the random number generator
  • NULL and null pointers
  • Introduction to typecasting

Starter files from the end of Functions and random numbers: functions and random numbers

Command line arguments and decisions

  • Using integer literals with srand for testing
  • Random number bias
  • The parts of a function
  • Command line arguments
  • Running command line tools from Terminal
  • Supplying command line arguments within Xcode
  • Decisions with if and if … else
  • Xcode warnings and errors
  • The Issue Navigator
  • The strtol function
  • The errno library
  • Variable scope

Starter files from the end of Command line arguments and decisions: command line arguments and decisions

More on decisions and functions

  • Using comments
  • Chaining decisions with if … else if … else ….
  • Enabling/disabling command line arguments within Xcode
  • <, <=, >, >= operators
  • Logical operators: ||, && and !
  • Truth tables
  • Evaluation of conditions with logical operators
  • Regression testing
  • Creating a function
  • The void keyword
  • The exit function
  • Difference between return statement in main and return statement in other functions

Starter files from the end of More on decisions and functions: more on decisions and functions

Loops

  • The while loop
  • The increment and decrement operators, ++ &  --
  • Prefix and postfix modes for increment and decrement operators
  • Programming errors leading to infinite loops
  • The for loop
  • Off by one errors
  • Index variables

Starter files from the end of Loops: loops

User input

  • The do … while loop
  • Removing command line arguments in Xcode
  • The scanf function
  • The reference operator, &
  • Showing/hiding the variables view in Xcode
  • Making scanf ignore white space
  • The fgets function
  • The sizeof() operator
  • The sscanf function

Starter files from the end of User input: user input

Challenge project 1

  • Source code for the programme to be converted: ACEYDUCY.BAS
  • Using Quick Help in Xcode

Solution to challenge project 1

  • Example Acey Ducey programme
  • Removing parameters from the main function
  • Using functions to separate programmes to structure your programme
  • Passing arguments by value, explicit reference and implicit reference
  • Comparing strings with the strcmp and strncmp functions
  • Evaluating strings based on their text encoding
  • Scanning strings with for loops
  • The tolower function
  • Creating reusable functions
  • Single statement loops and decisions
  • Swapping variables
  • The sprintf function
  • The switch command
  • Assigning strings with the strcpy function
  • Using the break command with switch
  • How the stack works
  • Why you shouldn’t return pointers to local variables
  • Dangling pointers
  • Separating model from interface
  • The stdbool library
  • The bool type
  • True and false values
  • The compound assignment operators: +=,  -=, *=, /= and %=

Project files for the solution: challenge project 1

Built version of the solution: Acey Ducey

Volume 2 of this tutorial series is now available.

This entry was posted in Games, Programming Tutorials and tagged , , , , , , . Bookmark the permalink.

2 Responses to "OS X games from the ground up: index"

Leave a reply