100 Days of Code Day 47
Ok let’s list today’s exercises.
series – return an array of substrings of a given length, but change each substring into an array of numbers. I sure did fuss too much on that one.
largest series product – I used pretty much the same reduce call as the previous entry. This time we are getting the largest product of digits for a given length. This time I added a regex to test that everything was a digit. Looks like testing for a non-digit would have been easier.
transpose – given a list of strings think of it like a matrix and switch columns for rows and rows for columns. AB, 12 => A1, B2 for example.
rectangles – count the rectangles in ascii art where | and – are the walls and + is the corners (also counts as a wall for overlapping rectangles). I made functions to scan right, down, left and up. When you find a + call scanRight which can call the others. The right and down functions will spawn more scans if they run across another +. Return the sum. Everyone’s solutions were more fancy than mine. I am not sure if I understood any of them however.
I see the Zebra puzzle in there! It is what stopped me in the C# track. Yikes! I think I have just crossed into the medium puzzles too. Not sure I can do this many a day anymore and I still need to gain an excess of 20 to downgrade things to one a day.
On the gameboy coding adventure side of things I got the two dma copy demos working with the second having 40 extra sprites on screen. I am now ready to move to Chapter 13 – Memory Bank Controllers.
