100 Days of Code Day 49
Today’s exercise as mentioned yesterday is the subset of Forth interpreter. Forth is a stack based language so you can say things like 5 3 + and it will push 5 then 3 on the stack, then pop 5 and 3 off the stack add them together and push 8 (the result) on to the stack. This was ranked hard and is the only exercise for today. I put a lot more effort into it back on the C# track and made a stand-alone interpreter. I could probably do that this time but I will let it be. I didn’t peek at the C# version, I am trying not to peek at my code for the same exercise on different tracks.
However, I did sneak in one more exercise late last night. I am not sure if I want to count it for today. I took a look at the Python track and saw I had a learning exercise and thought to myself, why not? Well it kicked my butt is why not. I may not remember as much as I thought. The real bear was pytest however. I remember pytest being much better. I couldn’t get this one to work with visual studio code, so I was just testing in power shell with optional break into the debugger on fail. Exercism added a bunch of “extra” stuff that confuses pytest too, so you had to add in a special config file to get rid of the problems they added in. Major pain from configuration headaches, I am sure they have significantly changed it since I last used the python track.
I only saw one demo in Chapter 14 – Interrupts. Did I miss any? Anyway for the sample you trigger a serial interrupt with bit twiddling when a button is pushed.
That was short so I did the next chapter too. There were two examples to show how to do things with and without jump tables. One for changing the fill character to a different value that jumps to a known spot in ram to catch jumps to bad addresses. Finally there was another for Linear Feedback Shift Registers in both 4 and 8 bit varieties (pictured). I find it strange that zero is not an allowed value.
The next chapter is Part IV – Beyond the Game Boy – Chapter 16 – Game Boy Color. Fun fact, the Gameboy color is the target I wanted. I want to make a game for my modretro chromatic (that I gave myself for Christmas).
