Games are great for intermediate level programmers, but they can be frustrating for beginners. Here are a couple of exercises that I undertook when learning games programming in C++ / Direct3D.
1. Bouncing ball.
What: A simple program. A screen and a single ball that moves diagonally and bounces of the edges.
Why: Teaches you sprites, bliting and collisions.
2. Multiple bouncing balls.
What: Every time the user clicks on the screen, it creates a new ball at that location that moves diagonally and bounces of the edges.
Why: Teaches you dynamic object creation, mouse listeners and the importance of alpha channels. Can be improved so that the balls bounce of each other (which illustrates the problems with basic collisions) and delete balls by clicking on them.
3. Pong
What: Your first real game! It should be very easy once you get your head around the above two exercises.
Why: Basic AI (very dumb, just follow the ball's horizontal position), score boards, level resets, pausing, basic OO in game design.
4. Breakout
Why: You can skip the above and move onto breakout which is a whole lot more fun. It utilities the same concepts as pong but it is a little more advanced in that you will need to make use of collections and visualize the layout of the blocks and create an appropriate loop to construct them. It is also a great introduction to polymorphism if you include blocks of different properties (unbreakable, hard, soft, different colors, etc).
5. Mandelbrot generator
What: Do a google search if need be. It is terrific, exhilarating fun. I literally spend hours at a time exploring my own generator and the first time it comes to life you will be blown of your chair screaming "Did I do that!"
Why: Brilliant introduction to complex mathematics (that's the imaginary type, not the hard type
. You get to see how real mathematicians formula's are written for a computer and best of all the formula is infinitely variable so there will always be room for tweaking/improving/modifying.
6. An Object persistence app
What: Doesn't really matter what the object is (but keep it simple and useful). I went for a library program that I could record books I have read. You will want a GUI and a way to create, edit, save and delete records.
Why: There are many ways to achieve persistancy (text file, binary file, XML, relational database and Hibernate to name a few). Get familiar with them because it is absolutely vital if you plan on writing anything substantial.
If you can get through all that then you are about on par with a first year computer scientist. The difference is, computer science lectures generally lack imagination when it comes to assignments and always lack context. Make things relevant to what you are interested in and you will be a superstar programmer in no time.