All Projects → sevenseat → rr-2048

sevenseat / rr-2048

Licence: other
2048 game in Reason React

Programming Languages

ocaml
1615 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to rr-2048

Bs Fetch
Fetch bindings for BuckleScript
Stars: ✭ 194 (+1193.33%)
Mutual labels:  reasonml
Lwt Node
Reason Implementation of Node.js API ✨🏎🚀✨
Stars: ✭ 226 (+1406.67%)
Mutual labels:  reasonml
bs-examples
some small examples showing how to use bucklescript/reason
Stars: ✭ 20 (+33.33%)
Mutual labels:  reasonml
Bastet
A ReasonML/Ocaml library for category theory and abstract algebra
Stars: ✭ 200 (+1233.33%)
Mutual labels:  reasonml
Rebolt Navigation
Fast and declarative router for Rebolt
Stars: ✭ 212 (+1313.33%)
Mutual labels:  reasonml
Relude
FP-inspired prelude/standard library for ReasonML projects
Stars: ✭ 230 (+1433.33%)
Mutual labels:  reasonml
Bs Material Ui
ReScript bindings for material-ui
Stars: ✭ 185 (+1133.33%)
Mutual labels:  reasonml
remotedata-re
Tools for fetching data from remote sources in Reason
Stars: ✭ 32 (+113.33%)
Mutual labels:  reasonml
Rescript Relay
Use Relay with ReasonML.
Stars: ✭ 214 (+1326.67%)
Mutual labels:  reasonml
Reason Graphql Fullstack
Fullstack Reason + GraphQL Todo List App
Stars: ✭ 246 (+1540%)
Mutual labels:  reasonml
Reason Urql
Reason bindings for Formidable's Universal React Query Library, urql.
Stars: ✭ 203 (+1253.33%)
Mutual labels:  reasonml
Bs Express
Express bindings in Reason
Stars: ✭ 207 (+1280%)
Mutual labels:  reasonml
Klipse
Klipse is a JavaScript plugin for embedding interactive code snippets in tech blogs.
Stars: ✭ 2,841 (+18840%)
Mutual labels:  reasonml
Httpkit
⚡️ High-level, High-performance HTTP(S) Clients/Servers in Reason/OCaml
Stars: ✭ 198 (+1220%)
Mutual labels:  reasonml
granary
Tezos smart contract & dapp development toolkit
Stars: ✭ 67 (+346.67%)
Mutual labels:  reasonml
Reasonml Cheat Sheet
A cheat sheet for ReasonML -- WIP
Stars: ✭ 187 (+1146.67%)
Mutual labels:  reasonml
Wonder.js
🚀Functional, High performance 3D Webgl Engine
Stars: ✭ 225 (+1400%)
Mutual labels:  reasonml
zestdb
ZestDB
Stars: ✭ 18 (+20%)
Mutual labels:  reasonml
bs-spectacle
No description or website provided.
Stars: ✭ 15 (+0%)
Mutual labels:  reasonml
Re Web
Experimental web framework for ReasonML & OCaml
Stars: ✭ 237 (+1480%)
Mutual labels:  reasonml

This is another implementation of the Game 2048 in Reason React. It was my first Reason React project, and is basically a fork of LIU9293's implementation.

Key Observations

  • Reason React is really easy to pickup. I am not much more than a javascript tinkerer, yet I was able to develop this, starting from Reason Scripts within 5-6 hours. The syntax proves very familiar for someone who knows javascript. It's readable and straightforward.
  • It was jawdroppingly powerful
    • Pattern Matching is amazing! I was hooked from the first one I wrote. It allows the programmer to focus on the logic, as the implementation becomes very easy.
    • Encouraged by the toolset, I found myself quickly migrating to more functional-style programming. I avoided loops, and found myself writing recursive code!
    • Tuples are great too. I loved wrapping-together a few variables and treating them as a unit. Although I found the parentheses syntax kinda confusing. There were times when I had 3-4 open or closed parentheses side-by-side for a simple callback function.
    • I loved the typechecking. I haven't programmed with types since the Java era. I can't believe that there was a bullet-proof typesystem that didn't require annotating everything. It just worked. I was floored when the typechecking found errors within my JSX. Wowzers.
  • I did have a number of challenges that took a little while to work-through
    • I found the module system a bit confusing. I couldn't figure-out how to create private helper-functions without putting them within the definition of the public function. That ended-up working for this project, however it makes it impossible to share these helper functions within the module, and it made unit testing harder. Module Signatures solve this ompletely
    • Jest doesn't fully support Bucklescript, yet. I worked mostly with linked-lists, but those aren't well supported by Jest. I usually had to convert an list to an array for testing purposes.
    • Given its newness, ReasonML there aren't a ton of Reason example code and Stack Overflow ansers out there. But there's a ton for OCAML, which maps 1:1 to reason. The playground proved invaluable, as I would paste-in OCAML and instantly get out Reason.
    • Reason / Bucklescript / React is HEAVY. This very light applicaiton is 58kb gzipped.... My code is a few hundred lines... THat's a lot of library code. I was somewhat surprised to see how much of it was Bucklescript code to handle language features like Linked Lists and Currying.

All-in-all, it's been a very fun experience. And I'm amazed with the power. I'm going to look for opportunities to use Reason, instead of javascript, going forward.

Todos

  • Fix keyboard bindings.... Right now the user has to click first. A bit stuck. Could use help here from any react experts
  • Detect game-over
  • Gestures
  • Delay adding new cells after transform for a fraction of a second
  • Retitle the page
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].