Microcodes
by Pall Thayer
Microcodes are very small code-based artworks. Each one is a fully contained work of art. On this page you can see contributed modifications of the original Microcodes that can be seen here.

Original code:

Enter your name (will be displayed):

Here you can enter extra info, such as warnings if the code can cause damage:

Enter code (must be complete and runnable):

No modified codes have been submitted for this Microcode.

The semi-automatic doodle machine
A bit longer than most but I like it so much I had to include it.
26. January 2010
#!/usr/bin/perl
print "Use a pencil and a 210mm x 210mm sheet of paper. Start with your hand at the upper-left corner.\n";
@position = ('up', 'down');
@direction = (['up', '-'], ['to the left', '-'], ['down', '+'], ['to the right', '+']);
@amount = (0, 0);
while(1){
	$d = int(rand(scalar @direction));
	$new_amount = int(rand(100));
	unless(eval("$amount[$d%2] $direction[$d][1] $new_amount") < 0 || eval("$amount[$d%2] $direction[$d][1] $new_amount") > 210){
		print "With pencil ".$position[int(rand(scalar @position))].", move ".$new_amount."mm ".$direction[$d][0].".[Enter]\n";
		$amount[$d%2] = eval("$amount[$d%2] $direction[$d][1] $new_amount");
		$input = <>;
	}
}

back to Microcodes