At the beginning, my KA programs were just simple changes to other people’s programs. As I got better, I wrote more and more of the code from scratch. My newer programs are almost always coded from scratch.
If you are trying to learn programming, I encourage you to check out the Khan Academy CS environment. It’s one of the best I’ve come across!
Technical details - KA programs are made using HTML5's