Playing with the Pico-8 fantasy console

I’ve been using Pico-8 as a virtual playground for playing with generative art ideas. Pico-8 is a highly constrained virtual machine that behaves a lot like a personal computer from the 1980s. It has a fixed colour palette, limited memory, limited screen size, and a simplified programming model using Lua. The constraints make it a great place to scale down ideas and quickly finish demos and prototypes. This week I’m toying with generative art ideas, starting with a tool that stamps the screen in various patterns. I’m hoping to evolve these prototypes into a general plotter library, but for now I’m focused on making things that look cool, as a way to play in generative code again. ...

February 19, 2022

PICO-8 tile art tests

I’ve been playing around in PICO-8, working on some generative art ideas. Lua is a fun little language that feels a lot like something between BASIC and JavaScript. Lua isn’t my favourite language, but it’s fun at the small scale. PICO-8, however, is a fantastic little game engine (or “Fantasy Console”) that has all of the feels of the 80s. First tests I started with a Minecraft style terrain generator, but as 2D tyles: ...

February 19, 2022

A JavaScript link mashup for Winter 2017: Things I used and liked in the JS universe this year

2017 was a good year for JavaScript. The newer language features are now part of our daily routine. Tightly integrated CI and packaging scripts are the norm, and we have a huge sea of libraries and tools available to us. The core JavaScript frameworks have settled down and matured to the point that we can be confident in JS as the base for large-scale commercial projects. Here are a few of the main JavaScript things that impressed me this year: ...

December 11, 2017

Five things to love about PHP

PHP is a great language. It follows a long lineage of C-based syntaxes, mirroring much of the C standard library. It performs well, is trivial to deploy, and has been stable for many years. And, it’s almost universally hated. While many people look down on PHP, it’s worth considering where it shines compared to other languages. I find that in many uses, PHP provides a great set of features and elegance. Not only is it competent, but there are places where it is truly a great little tool. ...

June 17, 2013

Simple sets in JavaScript

One of my favourite JavaScript features is its literal object notation. It allows you to declare data structures in JSON, which is a very succinct, C-like syntax. You can use this notation to declare SETs, and the a in b syntax to verify a variable is in a set: /* Declare your set as a JSON constant */ var valid_widgets = { 'widget-viewer': 1, 'special-viewer': 1, 'widget-editor': 1 }; /* Fail if something isn't in the set */ if ( ! (options.widget in valid_widgets) ) return false; /* Profit! */ As the in keyword operates on the index of the referred object, we set the value of the constants to 1 (true). A bit of a hack, but it results in a very clean way of checking if something is part of a set of valid values. ...

May 29, 2012

HOWTO: Directory recursion in Boost (and other tips)

Boost’s Filesystem library is an incredible resource: it abstracts paths, directories, and stat results. It simplifies coding shell problems in C++, it’s portable, and is maintained by a large community of contributors. The one downside of Boost is that some of its newer libraries are poorly documented. ((Something I want to contribute to.)) Until I have time to get involved in the Boost project, I’m going to post examples here. Traversing a directory tree ...

April 23, 2008