Merlyn has a good point there. There are tons of sites with sample code. You might look at the Big Nose Bird web site. They've got a lot of stuff like that and it's geared more towards the beginner.
Good luck!
Some people fall from grace. I prefer a running start...