Coder's Block

Will Boyd's Portfolio

Scenery
Dec 13
CodePen

Align 4 Game

The classic game, played against an AI opponent. Applies the minimax algorithm to pick its moves. Coded as a multi-threaded app using a web worker. Web workers require code to be executed from separate JavaScript files. The code here is the UI thread. If you want to see the web worker code, check out Align 4 Game (Web Worker). Higher difficulty levels are computationally expensive, so the computer's turn may take a while, especially on mobile devices. Blog post: Align 4 Retrospective: Writing a Multi-Threaded Game in JavaScript
Dec 11
Twitter

Via Twitter Web Client

Got ChromeVox enabled while listening to trance music. Imagining I'm in an accessible rave with robots singing along poorly.
Nov 16
WordPress

Crazy Meta CSS Hack

There are several HTML tags that aren’t rendered on a page. Tags like <head>, <meta>, <script> — all very important, but browsers don’t display them. The interesting thing is, browsers can display them, they’re just told not to by the user agent stylesheet: So what happens when you override the CSS that hides them? Crazy...
Nov 6
WordPress

Fun Times with CSS Counters

CSS counters are one of those “oh neat, didn’t know CSS could do that” features with a lot of interesting potential. In simple terms, they let you keep a running tally of things in CSS — no JavaScript needed. Basic Counter Here’s an easy pagination example to get us started: See the Pen Pagination CSS...
Nov 3
WordPress

JavaScript Strict Mode

Strict mode in JavaScript causes your code to be interpreted under a stricter set of rules. JavaScript will nag you more and throw exceptions for things it previously had no issue with. This may not sound like a good time, but your code will be better for it. Strict mode is like a built-in linter,...