You are currently browsing articles tagged programming.

On top, we have a table of truth values that result when comparing values of different types in PHP. On bottom, we have a chart illustrating the strengths and weaknesses of the seventeen types of Pokémon. Is it crazy to wonder whether one might have influenced the other?

The former is a matrix of arbitrary values intended to produce convenience. The latter is a matrix of arbitrary values intended to produce fun. In my experience, neither achieves its goal. But both follow an arbitrary logic, strangely twisted through history and culture, that might someday make a good subject for a Ph.D. thesis. (Why does a non-empty string equate with integer zero? Why is Psychic strong against Poison?)

Tags: , , ,

(NOTE: This project is currently out of commission as I find a new place to host it and adjust the code to accommodate recent changes in the Twitter API.)

My day 2 project is called twbasic. It’s an implementation of classic, line-numbered, home computer-era BASIC that runs on top of Twitter. You can start using twbasic right now by twittering your program listing to @twbasic. Here’s how to get twenty rolls of a six-sided die:

@twbasic 10 for i = 1 to val(ARG$)
@twbasic 20 print rnd(6) + 1
@twbasic 30 next i
@twbasic run 20

(The above screenshot depicts twbasic providing a listing of the program above, and then the results of running the code.)

A reference for using twbasic can be found after the jump.

Read the rest of this entry »

Tags: , ,