2 ms·
HN lunch challenge: Many here have noted one should be able to do this with far fewer total states by ignoring the order of the moves and focusing only on what
by zamadatix 3y ago
HN lunch challenge: Many here have noted one should be able to do this with far fewer total states by ignoring the order of the moves and focusing only on what the next board state needs to be. Who can generate the smallest working HTML file first? Preferably with how they generated the HTML too.
- abecedarius 3y agokragen made something like this decades ago, except it was one HTML page per state. Some code I wrote to generate a small table using BDDs is at https://codewords.recurse.com/issues/four/the-language-of-choice https://codewords.recurse.com/issues/four/the-language-of-ch... Also from there: > In a 6th-grade science fair Steve Wozniak did [a tic-tac-toe machine] much better: “about 100 transistors and about 100 diodes.” How? Beats me!
- p4bl0 3y agoI got 560KB. More than 300 times smaller. See my comment here: https://news.ycombinator.com/item?id=38266987 https://news.ycombinator.com/item?id=38266987
- p4bl0 3y agoI got down to 412KB! https://gist.github.com/p4bl0-/abf4960f07045d7a443230a46e73b849 https://gist.github.com/p4bl0-/abf4960f07045d7a443230a46e73b...
- p4bl0 3y agoAnd now to 367KB! By removing quotes around HTML attributes ^_^… https://gist.github.com/p4bl0-/abf4960f07045d7a443230a46e73b849#file-ttt_smallerer-py https://gist.github.com/p4bl0-/abf4960f07045d7a443230a46e73b...