Today’s exercise was simple-cipher. It is really the Vigenère cipher, it is like the Caeser cipher except instead of one shift for the whole message, you have a long key text where you shift according to the matching position of the message and key where a=0 (no shift) and d=3 and so forth (wrap around if the key is shorter than the text). Not too hard. My implementation sure is more simplistic than the community ones. I just used some for loops, didn’t see the need to use a bunch of map, reduce calls. The encode and decode methods are almost the same. I probably could have refactored them into a shared function. OK, fine, I updated it to get rid of the duplicate code, you don’t have to guilt me.

For being named ch3_simple I sure had to debug it a lot. I noticed that if you press A and B at the same time you get an interesting warble. That example was to just show channel 1 and 3 sound the same when playing the same square wave. By the way _AUD3WAVERAM is still correct. Ch3_waveforms on the other hand worked the first time. Ch3_full, I started with a copy of Ch2_full then started adding the new stuff. I got tired half way through and copied the code over from the github and just fixed it up for the new hardware constants. Then I rushed through ch4_example and ch4_full. I thought I was done with the sound chapter at least. Then on the last page it mentioned sound_test. Sort a final boss combination of all of the tests.

Do I want to tackle that today? Why do I guilt myself? I did it. I am now officially ready for the next chapter even though I largely just copy/pasted the last few samples.