Tic-tac-toe: reflections on a classic programming challenge

Coding up a game such as Tic-tac-toe is a classic programming challenge, but one which I never took much more than passing interest. I mean: I can see it is a good quick-start tutorial to a language/tool (e.g. React quick start). I also really enjoyed it when I did it for the first time. But after the first time, why do it again and again and again? But recently I changed my mind.

READ MORE

Table Talk of Nick Ribal

Who wrote these articles. All the misinterpretations are my own. Styling web components HTML was originally designed for documents. For documents, the cascading styles of CSS makes sense: you want uniform styling across the global environment, with fall-backs as necessary. But for web apps, the document model doesn’t make sense. You want separate components for different things (buttons, menus etc). For a component, you want all the styles to be confined to the component itself: you don’t want a situation where the overall style sheet may affect the look of a button.

READ MORE

Marginalia Search

A short time before I started following blogs with RSS, I came across Dan Luu’s blog (someone was referring to it as an example of a good looking blog with no CSS at all). It was a treasure trove of well thought-out and very well-written essays. And one of the most interesting pieces is about search engines, where (among others) Luu claims that one of the best search engines around is an indie project called Marginalia Search.

READ MORE

Clojure conj: lists v vectors

At this juncture, I noticed an interesting pattern with the behaviour of conj in Clojure. As per ClojureDocs: ;; notice that conjoining to a vector is done at the end (conj [1 2 3] 4) ;;=> [1 2 3 4] ;; notice conjoining to a list is done at the beginning (conj '(1 2 3) 4) ;;=> (4 1 2 3) Why? According to a Perplexity AI answer and my PromptBros agent, it is because:

READ MORE

More ClojureScript Koans

I could only programme for a very short time today, so decided to have another crack at Clojure Koans. This puzzle is a good brain teaser. Dill in the ___ below. (= 25 ( ___ (fn [n] (* n n)))) I was stuck and decided to make a Clojure tutor bot on PromptBros to chat with. Again, it didn’t give the right answers: the apply function (if correctly explained) requires an input after the function, not before.

READ MORE