Nice work! :) 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. Playable here: http://t3tr0s.com/ Repo: https://github.com/imalooney/t3tr0s
Show HN: Tetris Implemented in ClojureScript
11–20 of 26 posts
Re: Show HN: Tetris Implemented in ClojureScript
#12This 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 +…
Clojure has better and more map handling functions in the std lib for sure, but I find that with the help of some libs you can write lots of Javascript in a Clojury way without too much hassle.
Re: Show HN: Tetris Implemented in ClojureScript
#13This 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 +…
Why pick Typescript instead of Javascript as a comparison? there's really not that much difference in your example if plain javascript objects/arrays/functions was used. Clojure has better and more map handling functions in the std lib for sure, but I find that with the help of some libs you can write lots of Javascript in a Clojury way without too much hassle.
Re: Show HN: Tetris Implemented in ClojureScript
#14Earlier quoted context omitted.
Why pick Typescript instead of Javascript as a comparison? there's really not that much difference in your example if plain javascript objects/arrays/functions was used. Clojure has better and more map handling functions in the std lib for sure, but I find that with the help of some libs you can write lots of Javascript in a Clojury way without too much hassle.
Typescript is becoming a popular alternative to JS and is often being chosen to correct the perceived shortcomings of JS. Just like ClojureScript, which is often chosen to correct the perceived shortcomings of JS ;)
Re: Show HN: Tetris Implemented in ClojureScript
#15Both the game and the source are much more minimal, it's very easy to customise the rules. You can see the source here: https://github.com/gunn/tetris/blob/master/src/store.js
Re: Show HN: Tetris Implemented in ClojureScript
#16Earlier quoted context omitted.
Typescript is becoming a popular alternative to JS and is often being chosen to correct the perceived shortcomings of JS. Just like ClojureScript, which is often chosen to correct the perceived shortcomings of JS ;)
You picked on static typing, which Clojurescript doesn't have.
Re: Show HN: Tetris Implemented in ClojureScript
#17Here's my tetris copy: http://wolandbros.com/tetris/ Both the game and the source are much more minimal, it's very easy to customise the rules. You can see the source here: https://github.com/gunn/tetris/blob/master/src/store.js
Re: Show HN: Tetris Implemented in ClojureScript
#18This 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 +…
Why pick Typescript instead of Javascript as a comparison? there's really not that much difference in your example if plain javascript objects/arrays/functions was used. Clojure has better and more map handling functions in the std lib for sure, but I find that with the help of some libs you can write lots of Javascript in a Clojury way without too much hassle.
Re: Show HN: Tetris Implemented in ClojureScript
#19Up being rotate rather than hard drop is tripping me up. I guess I could fork it, though. :)
I was following https://tetris.com/play-tetris , but I would be down to change it. It messes me up when I use the HJKL mapping.
Re: Show HN: Tetris Implemented in ClojureScript
#20Earlier quoted context omitted.
Typescript is becoming a popular alternative to JS and is often being chosen to correct the perceived shortcomings of JS. Just like ClojureScript, which is often chosen to correct the perceived shortcomings of JS ;)
You picked on static typing, which Clojurescript doesn't have.
Here's a good video highlighting the difference of approach. Well worth watching. Applies to how many Java architects would design a solution. I see the same kind of top-down approach happening in the Typescript area as well.
https://www.youtube.com/watch?v=Tb823aqgX_0&list=PL0ydHZ1qvY...