This is super condensed but still very readable if you know Reagent and Hiccup.<p>It's interesting to compare this to a lot of tetris clones written in TypeScript. There are a few that take enormous pleasure in defining a type hierarchy and what not.<p>Contrasting that to the very compact representation of tetrominos<p><pre><code> {:I {:color "#1197dd"
:dim [4 1]
:zero [1 0]
0 [[-1 +0] [+0 +0] [+1 +0] [+2 +0]]
1 [[+1 -1] [+1 +0] [+1 +1] [+1 +2]]
2 [[-1 +1] [+0 +1] [+1 +1] [+2 +1]]
3 [[+0 +1] [+0 +0] [+0 -1] [+0 +2]]}
</code></pre>
and the very cute rotate function:<p><pre><code> (defn rotate [r] (-> r inc (mod 4)))
</code></pre>
gives you a good idea what a Lisp is about.
Nice work! :)<p>A few years ago some friends and I wrote a tetris clone to celebrate the 30th anniversary of tetris and learn ClojureScript in the process. Really fun group project.<p>Playable here: <a href="http://t3tr0s.com/" rel="nofollow">http://t3tr0s.com/</a><p>Repo: <a href="https://github.com/imalooney/t3tr0s" rel="nofollow">https://github.com/imalooney/t3tr0s</a>
Here's my tetris copy: <a href="http://wolandbros.com/tetris/" rel="nofollow">http://wolandbros.com/tetris/</a><p>Both the game and the source are much more minimal, it's very easy to customise the rules. You can see the source here: <a href="https://github.com/gunn/tetris/blob/master/src/store.js" rel="nofollow">https://github.com/gunn/tetris/blob/master/src/store.js</a>
This is sick! Link to source:
<a href="https://github.com/djblue/tetris" rel="nofollow">https://github.com/djblue/tetris</a>
If interested in more ClojureScript games, I made Breakout: <a href="http://city41.github.io/reagent-breakout/" rel="nofollow">http://city41.github.io/reagent-breakout/</a>