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):

Abstraction
06. March 2009
#!/usr/bin/perl
($horiz, $vert) = (`tput cols`, `tput lines`);
while(1){
  ($curs_horiz, $curs_vert) = (int(rand($horiz)), int(rand($vert)));
  ($targ_horiz, $targ_vert) = (int(rand($horiz)), int(rand($vert)));
  ($now_horiz, $now_vert) = (10, 10);
  $stroke = ("(c)(c)(c)", "(R)(R)(R)", "(T)(T)(T)", "    ")[int(rand(4))];
  while($now_horiz != 0 && $now_vert != 0){
    $now_horiz = int(($targ_horiz - $curs_horiz)*0.1);
    $now_vert = int(($targ_vert - $curs_vert)*0.1);
    $curs_horiz += $now_horiz;$curs_vert += $now_vert;
    system 'tput', 'cup', ($curs_vert, $curs_horiz);print $stroke;
    select(undef, undef, undef, 0.15);
  }
}
Joseph Gray
Fibonacci Strokes Version
#!/usr/bin/perl
($horiz, $vert) = (`tput cols`, `tput lines`);
while(1){
  ($curs_horiz, $curs_vert) = (int(rand($horiz)), int(rand($vert)));
  ($targ_horiz, $targ_vert) = (int(rand($horiz)), int(rand($vert)));
  ($now_horiz, $now_vert) = (10, 10);
  $stroke = ("                    ", " - -  --   ---     -----        --------", " | |  ||   |||     |||||        ||||||||", " > >  >>   >>>     >>>>>        >>>>>>>>", " < <  <<   <<<     <<<<<        <<<<<<<<", "--------        -----     ---   --  - - ", "||||||||        |||||     |||   ||  | | ", "<<<<<<<<        <<<<<     <<<   <<  < < ", ">>>>>>>>        >>>>>     >>>   >>  > > ", "                    ")[int(rand(10))];
  while($now_horiz != 0 && $now_vert != 0){
    $now_horiz = int(($targ_horiz - $curs_horiz)*0.1);
    $now_vert = int(($targ_vert - $curs_vert)*0.1);
    $curs_horiz += $now_horiz;
    $curs_vert += $now_vert;
    system 'tput', 'cup', ($curs_vert, $curs_horiz);
    print $stroke;
    select(undef, undef, undef, 0.15);
  }
}
Joseph Gray
Fibonacci Strokes Round 2
#!/usr/bin/perl
($horiz, $vert) = (`tput cols`, `tput lines`);
while(1){
  ($curs_horiz, $curs_vert) = (int(rand($horiz)), int(rand($vert)));
  ($targ_horiz, $targ_vert) = (int(rand($horiz)), int(rand($vert)));
  ($now_horiz, $now_vert) = (10, 10);
  $c = ("","-", "|", ">", "<", " ")[int(rand(6))]; $stroke = "";
  $i = 0;  $l = 6;  $a = 1; $b = 1;
  until ($i == $l) {
	$num = $b; $b += $a;  $a = $num;
	$k=0; while ($k<=$i) { $stroke = "${stroke} "; $k++; }; 
	$k=0; while ($k<=$i) { $stroke = "${stroke}${c}"; $k++; }; 
	$i++;
  }
  while($now_horiz != 0 && $now_vert != 0){
    $now_horiz = int(($targ_horiz - $curs_horiz)*0.1);
    $now_vert = int(($targ_vert - $curs_vert)*0.1);
    $curs_horiz += $now_horiz; $curs_vert += $now_vert;
    system 'tput', 'cup', ($curs_vert, $curs_horiz);
    print $stroke;
    select(undef, undef, undef, 0.15);
  }
}

back to Microcodes