Today’s exercises were:

  • Diamond – Draw a diamond shape with A-Z starting at A but making a triangle then the reverse (see below) to close out a diamond shape.
  • Rational Numbers – Math library for rational numbers. I did not get the pth root of q right (they didn’t explain it or provide a link that explains it nor did a quick search find anything). I did it a different way that largely works, but I did have to change the order of operations to get the floating point results to behave.
  • Sublist – I probably overcomplicated this one but it works. Just see if a list is not-equal, equal to, or a sub/superlist of another list.
  • Binary Search Tree – Implement a binary search tree that allows insertion of nodes and iterating over nodes. The each function was not in the problem definition and I puzzled for quite a while trying to figure out what they wanted. I thought they were iterating over a returned list/iterator for a bit but no they just wanted me to call a function with each bit of data in the tree.

Diagram of what the diamond should look like with a parameter of ‘D’:

   A   
  B B  
 C   C 
D     D
 C   C 
  B B  
   A   

 

Ok, on to Game boy Coding Adventure. It turns out I do have a Gameboy Printer and some thermal paper. It sure requires a lot of batteries to run (six AA). Haven’t actually tried it yet. My Sister gave it to me when she was getting rid of some old stuff she didn’t want anymore.

Well I typed everything up and got it compiling. I wanted to run it on the simulator first but I couldn’t get them to talk to each other. The best I got was an Error #02 – Bad Connection. Eventually I threw caution to the wind and and put it on the flash cart.

It was when I was plugging a huge amount of batteries in that I noticed my thermal paper was way too wide. However, it looks like my sister included a roll of the original paper. So instead of letting it stay unused another few decades, I decided to put it in instead. It is hard to load the thing. I think the sticker paper is making it harder. Anyway, once it was out of the emulator box, it actually worked. Well mostly.  You can barely see the printout. I am not sure if it is the old thermal paper or something else. However, the picture for this post has that section of the image digitally enhanced and it is still hard to see. This was the only demo in the chapter, so on to Chapter 18 – Super Gameboy which looks really long. I have also officially passed the three quarters mark of the book which includes index and appendices.

Chapter 19 is the last chapter, so I am nearly done with this book. Afterwards, I will have to actually make something of my own. I was thinking of going back to the DVD logo bouncer and adding Game Boy color mode, the lsfr 8 bit random number generator to make the bounce vary by +/- a pixel or two on each bounce so it doesn’t just stay in one place forever. Also if I can manage it, a horrible rendition of Jingle Bells running in the background. I would also like a sound effect on each bounce. If I can manage all of that maybe I could make a small breakout clone.