Project 12 -- lessons learned

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Project 12 -- lessons learned


I have finished coding Project 12 and following are my lessons learned from this experience.

-The classes can be implemented in any order. I started with Math class but when I got stuck  I moved to other classes and came back to Math class later.

-It helps to write classes in another language like Python before writing them in Jack.

-It might help to revisit chapter 9 before chapter 12. There are two chapters between chapter 9 and chapter 12, that involve doing lot of work in a language other than Jack. Before making any progress in Project 12 I actually had to go back and do it all over again before coming back to chapter 12.

- Until you see Pong game running in VM Emulator, dont think that everything is right with your code even if your classes pass all the individual tests.

- The Screen class tests probably does not check clearScreen() method. So the code could pass screen test but Pong will fail.

- When the code hangs with "Running" message then press the stop button and look at the call stack to find out which function was called last to use it as a starting point for debugging.

- Use parantheses around all the logical operations that result in True/False. This is especially important if there are more than one logical comparison inside an if/while statment like the following one.

    if( ((squaredValue=x) | (squaredValue<x)) & (squaredValue>0) ) {}

This caused me lot of grief even though I knew it from chapter 9 but this had slipped from my mind.

- Jack OS error codes give info about the possible errors that could occur and where the check should be put in code.

Good Luck with project 12.