Show HN: Tetris Implemented in ClojureScript
djblue.github.io
Show HN: Tetris Implemented in ClojureScript
1–10 of 26 posts
Re: Show HN: Tetris Implemented in ClojureScript
#2Re: Show HN: Tetris Implemented in ClojureScript
#3This is sick! Link to source: https://github.com/djblue/tetris
Re: Show HN: Tetris Implemented in ClojureScript
#4Re: Show HN: Tetris Implemented in ClojureScript
#5Re: Show HN: Tetris Implemented in ClojureScript
#6Up being rotate rather than hard drop is tripping me up. I guess I could fork it, though. :)
Re: Show HN: Tetris Implemented in ClojureScript
#7It'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.
Contrasting that to the very compact representation of tetrominos
{: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]]}
and the very cute rotate function: (defn rotate [r] (-> r inc (mod 4)))
gives you a good idea what a Lisp is about.Re: Show HN: Tetris Implemented in ClojureScript
#8Up being rotate rather than hard drop is tripping me up. I guess I could fork it, though. :)
Re: Show HN: Tetris Implemented in ClojureScript
#9A 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.
Playable here: http://t3tr0s.com/
Re: Show HN: Tetris Implemented in ClojureScript
#10This is super condensed but still very readable if you know Reagent and Hiccup. 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. Contrasting that to the very compact representation of tetrominos {:I {:color "#1197dd" :dim [4 1] :zero [1 0] 0 [[-1 +0] [+0 +0] [+1 +0] [+2 +0]] 1 [[+1 -1] [+1 +0] [+1 +…