Beginning Programming

From eLinux.org
Revision as of 19:28, 29 January 2013 by Tim Bird (Talk | contribs) (Programming toolkits)

Jump to: navigation, search

This page is intended to help beginners get started with learning programming. Eventually, I'd like to provide a whole series of steps, exercises and tutorials about programming, to help anyone who would like to get involved with software development or game development.

Programming toolkits

"Questions Tips & Feedback Spin-Offs Documentation". "Spin-Offs" has sample programs related to the tutorial, video or program you're looking at, and "Documentation" has description of different functions or statements you can use in your programs.

Programming checklist

Follow these steps to learn how to program:

The very basics

  • learn what a program statement is (and what a "computer language" is)
  • learn what a variable is
  • learn what a conditional (if statement) is
  • learn what a loop is
  • learn what input is
    • different kinds of input (key press, mouse move, mouse button)
  • learn what output is
    • different kinds of output (text, image, sound)

Simple program 1: Write a program that counts how many times someone presses the space bar.

Simple program 2: Write a program that counts how many times someone presses each arrow key.

program 3: Write a program that starts counting when someone presses the space bar, and stops counting when they hit it a second time (like a stop-watch).

Program 4: Write a program that moves a ball to the right on the screen, when the right arrow is pressed.

Program 5: Write a program that starts a ball moving when key is pressed. The ball should keep moving until it hits a wall.

Note: For any of these programs, you can start with the program you used previously, and expand or modify it to do the next task. You should save it under a new name.

Program 6: Write a program that starts a ball moving in a different direction, depending on which arrow key (up, down, left, right) is pressed.

Program 7: Write a program that starts with a moving ball. When the ball hits a wall, it moves in the opposite direction.

Program 8: Combine programs 6 and 7. Write a program that starts a ball in a direction based on the key pressed. The ball should keep moving after the key is released. It should bounce off the wall and go the other direction when it hits a wall.