4 ms·
The TLDR summary of the article is its really easy to get stuck down a mineshaft of "I'm sure they're looking for a more elegant way to do this". (edited to add
by VLM 11y ago
The TLDR summary of the article is its really easy to get stuck down a mineshaft of "I'm sure they're looking for a more elegant way to do this". (edited to add, because scalability... demand fizzbuzz run 1...1e99 or under some weird time constraints and all bets are off, but no, its 1...100)
The comment on the article of a similar example of print an ASCII art diamond claiming cleanly using symmetry is unusable sticks in my brain a bit. There's gotta be a way! I mean, there has to be, right? But my first bright ideas all involve limitations that would be very non-clean and limitation inducing, although they would be cool applications of symmetry.
- gresrun 11y agoThis is a bit too involved for a whiteboard problem, IMO, but it isn't that hard to create a relatively clean solution: https://gist.github.com/gresrun/602bd53dad80bb51bb94 https://gist.github.com/gresrun/602bd53dad80bb51bb94
- detrino 11y agoI think I found the symmetry: http://ideone.com/KnaAMm http://ideone.com/KnaAMm Edit: Now with more symmetry: http://ideone.com/edNgre http://ideone.com/edNgre
- detrino 11y agoLess repetition: http://ideone.com/yPQzy6 http://ideone.com/yPQzy6