Sunday, November 23, 2008

IncrediBots: Physics Sim or Toy?

I've been playing the free online sandbox physics game IncrediBots and I'm enjoying it. I'm tired right now but I wanted to post a simulation of a bot I created, which I'm calling "Multi-Extend Schrang." It has four pistons, with a motorized wheel on the end of each. It can handle a number of terrains. I'll be putting up a video soon of how it handles some of the obsticles I've tried to cross with it.



Controls: QWER to extend pistions (left to right respectively) and ASDF to withdraw pistons (left to right, again). Use the Left and Right arrows to spin the wheels (they all move at once). Notice that the bot can stand on only two or three pistons and still move.

Friday, October 10, 2008

Weird Programming Languages

As if programming wasn't weird enough already, some people have taken it into their hands to design programming languages for humor value, or just to show it can be done. A great place to start is BF, a language designed to be extremely minimalistic while still Turing Complete (able to do certain calculations). It works in terms of a long "tape" of cells, in order from cell zero on to (theoretically) infinity. The program controls a "pointer" which moves from cell to cell to preform operations on the number stored in each cell.
The following program inputs two numbers, multiplies them, and outputs the answer.
Multiplication is repeated addition. The program is no more efficient than counting on your fingers, but it's automated. There is also a brilliant ZZT engine that simulates it and lets you see exactly what the program is doing. (This doubles as a proof-by-simulation that ZZT is turing complete).

BFZZT multiplication in progress
Here's my multiplication program, mid-way between multiplying 2 by 3 (I use small numbers because of how long the program takes to run when I slow it down to a speed I can watch!).

Other weird programming languages I have recently read about include LOLCODE ( a work in progress, not finished yet) that goes something like this:

HAI
CAN HAS STDIO?
VISIBLE "HAI WURLD"
KTHXBAI

This would be so much fun to program in.