Building Tic Tac Toe in ClojureScript (Reagent/Figwheel)

  Рет қаралды 15,629

Timothy Pratley

Timothy Pratley

Күн бұрын

Пікірлер
@asdawece
@asdawece 6 жыл бұрын
at 06:39 the line behind Timothy's head: (prn (swap! app-state update-in [:board j i] inc) thank you for great tutorial definitely best tutorial about clojurescript for starters
@BritainRitten
@BritainRitten 9 жыл бұрын
Thanks for the video! Unfortunately the bottom right of the editor is blocked by the video of (I assume) Timothy. Can you post what the :on-click function read at around 6:30? Is it something like this? (swap! app-state update-in [:board i j] inc)
@timothypratley
@timothypratley 9 жыл бұрын
+BritainRitten Hi BritainRitten, Yes you are correct. One small thing though; j before i, so: (swap! app-state update-in [:board j i] inc) The reason being that for a nested vector: [[0 0 0] [0 0 0] [0 0 0]] The first dimension is the row (y or j), and the second dimension is the column(x or i). Of course you can do it the other way, so long as you are consistent with the other places where update/reads are made :) Thank you for commenting.
@LauBJensen
@LauBJensen 8 жыл бұрын
Fantastic job on this video Timothy! Love the finishing touch of uploading to Github and looking forward to seeing more from you!
@timothypratley
@timothypratley 8 жыл бұрын
Thank you Lau :)
@codeasone
@codeasone 7 жыл бұрын
First class. The highest S/N I've seen from a video of this kind. Excellent detail level and pacing.
@timothypratley
@timothypratley 7 жыл бұрын
Thank you very much Mark :)
@jackdbd
@jackdbd 4 жыл бұрын
I really like the approach of using a viewbox of "0 0 3 3" for the container SVG
@jblistener7491
@jblistener7491 9 жыл бұрын
This is excellent! I hope you get a chance to do more of these videos in the future! :)
@timothypratley
@timothypratley 8 жыл бұрын
+jb listener Thankyou for the encouragement
@SaMusz73
@SaMusz73 4 жыл бұрын
Great demo of clojurescript. It feels the complication comes more from the svg syntax than clojure itself. Some vec of vec seems somewhat an overkill for a tictactoe game as this is such a small matrix it could also have been modelled as a simple list. Winning conditions would have been a bit different sure. Thanks a lot for showing the complete process up to the gh-page branch publishing. Neat !
@dryanwarrener
@dryanwarrener 4 жыл бұрын
I cannot seem to compile my project using lein figwheel as it just fails. I have followed the stesp but I get this error: stackoverflow.com/questions/65263325/cannot-get-leiningen-commands-to-work-with-figwheel
@eddy147Tennis
@eddy147Tennis 6 жыл бұрын
Great video. Great narratar. Would you mind sharing your editor setup?
@timothypratley
@timothypratley 6 жыл бұрын
Hi Eddy, thank you! In this video I am using emacs. I've written a little about my emacs setup here: timothypratley.blogspot.com/2015/07/seven-specialty-emacs-settings-with-big.html. There are links to the complete setup files in the article, but I have not updated my emacs setup in a very long time, so I don't recommend using them directly. Lately I mostly use IntelliJ IDEA with the Cursive Clojure plugin more often than emacs because there are less key combinations to remember.
@change3920
@change3920 6 жыл бұрын
Excellent tutorial. Thank you.
@timothypratley
@timothypratley 6 жыл бұрын
Thank you :)
@jimar
@jimar 9 жыл бұрын
Hi Tim, noob here. I typed this in and this doesn't work? $ lein new figwheel tictactoe -- --reagent Unrecognized option: -- . Should be one of --om --reagent Continuing with just: lein new figwheel tictactoe --reagent // cd tictactoe // lein figwheel I get, java.io.FileNotFoundException: Could not locate cljs/analyzer__init.class or cljs/analyzer.clj on classpath:
@timothypratley
@timothypratley 9 жыл бұрын
+Jimar Miller Hi Jimar, I suspect the problem is the version of Leiningen. For reference I am using 2.5.3 $ lein --version Leiningen 2.5.3 What version are you on? Perhaps try updating if you are on an older version (lein upgrade if you installed manually). When I copy pasted your line it worked well, so I hope it is just a version thing... please let me know if not. If you want to skip that step you can also copy the project.clj and index.html from github.com/timothypratley/reanimated/
@zanzimihejevs650
@zanzimihejevs650 8 жыл бұрын
great vid, was fun to watch!
@timothypratley
@timothypratley 8 жыл бұрын
+Zans Tangle Thankyou :)
@Zolton0111
@Zolton0111 4 жыл бұрын
Great job! Thanks a lot!
@indeecjo
@indeecjo 7 жыл бұрын
Thats awesome. Needs so much more love.
@govind_lahoti
@govind_lahoti 8 жыл бұрын
Awesome. Thanks a lot
@teckyify
@teckyify 8 жыл бұрын
I must say this convinced me how complicated the clojure code is to read and sometimes unnecessarily complicated to write than, for example, JavaScript.
@FellshardYT
@FellshardYT 8 жыл бұрын
Learning to read a lisp may take a little time, but becomes second-nature before long. The complexity in Clojurescript comes solely from the domain you're working with, unlike Javascript, which is entangled in the complexities it makes for itself as a language.
@timothypratley
@timothypratley 8 жыл бұрын
Thank you for the feedback. Many people have the same reaction. My goal was to show how quickly you can get a project started, how concise, powerful, flexible and interactive developing in ClojureScript is, and how fast you can build interesting things, and deploy them. Hopefully I was able to show a taste of that and inspire some people to give it a try. At this pace it should seem like there is a lot going on, because well... there is :) If you found aspects of my video distracting or requiring more information, I'd love to learn and improve on them for next time. Learning a new programming language is not a small thing, so some serious motivation is required to convince people of ClojureScript's merits. Derek Slager does a great job of this in his video here: kzbin.info/www/bejne/naTJl5prrd15h6s Rich Hickey's talk kzbin.info/www/bejne/jITHn316hJKrmsk gives a very precise definition of why Clojure is a simple language, and contrasts it directly with Java in many places. Clojure is a really good language for new programmers to learn because at its heart, it is very simple and regular. Logo (also known as turtle) was designed to teach programming, and is a lisp (like Clojure). This video has more details: kzbin.info/www/bejne/ZpeuoXqvZ7aog68 I hope some of these can convince you that Clojure is worth the effort, as I certainly have found that it is for me.
@bichitomax
@bichitomax 9 жыл бұрын
Muy bueno!
@indeecjo
@indeecjo 7 жыл бұрын
Hi thanks for the guide. I created a version following your guide with tiny little bit of logic on github.com/motiko/cljs-ttt Plan to improve until its unbeatable (shouldn't be too hard and a good practice). Thanks again its awesome.
@timothypratley
@timothypratley 7 жыл бұрын
cool :) I like the trash talking computer responses :)
ClojureScript for Skeptics - Derek Slager
41:09
ClojureTV
Рет қаралды 70 М.
Sente Style Multiplayer Snake in ClojureScript
7:46
Timothy Pratley
Рет қаралды 2 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Introduction to ClojureScript and Reagent
1:27:42
Decypher Media
Рет қаралды 29 М.
ClojureScript: Lisp's Revenge • David Nolen • GOTO 2013
32:03
GOTO Conferences
Рет қаралды 45 М.
Bruce Hauman - Developing ClojureScript With Figwheel
45:31
ClojureTV
Рет қаралды 55 М.
Предел развития НЕЙРОСЕТЕЙ
18:53
Onigiri
Рет қаралды 167 М.
Clojure: A live Demonstration of Simplicity That is Production Ready - Nir Rubinstein
45:39
How To PLAN your Game as a Solo Developer
16:26
Heartbeast
Рет қаралды 530 М.
C++ vs Rust: which is faster?
21:15
fasterthanlime
Рет қаралды 409 М.
re-frame your ClojureScript applications - Shaun Mahood
30:35
ClojureTV
Рет қаралды 15 М.
Deep dive into Clojure HTTP Basics: Ring, Compojure, Jetty!
27:37
Andrey Fadeev
Рет қаралды 4,2 М.
The Next Five Years of ClojureScript - David Nolen
1:00:58
Metosin
Рет қаралды 19 М.