This week’s ICM assignment was to use functions in a new or existing program. I chose to revise and continue work on Trumpong!
See the new and improved version here: http://lmj.io/projects/icm/trumpong-revised/
I started by recreating the existing game board in functions, then I put the board itself into a function, so I could create homepage and replay functionality. I put the homepage, game board, and replay all into their own functions so I could then play each part of the game in succession.
Everything went pretty smoothly, except I couldn’t manage to draw the star on the homepage, so I just pulled in a graphic for it.
Here’s the code: