100 Days of Code Day 44
No 2048 today. Instead I started a second exercise. The first was Dominoes. In that one you check and see if a pile of dominoes can be set end to end in a ring of matching counts. It was hard but doable. I did a depth-first search type solution.
The second is a bit extreme. A subset of a Forth interpreter. They said to try using Sprache, so I did. I have been wanting to make a BASIC interpreter and bigger parser libraries are frankly intimidating. So I decided I wanted to give it a try.
So far I have it parsing numbers and running add, subtract, multiply, and divide for integers. Detecting a minus sign versus a negative number has been quite a pain. I eventually decided to do a peek ahead for a digit to tell the difference. The 14 tests I enabled so far are passing. I still need to add words, and built-in stack operations. Sorry, no picture to show today.