Microcodes by Pall Thayer http://pallit.lhi.is/microcodes Microcodes are small code-based artworks Pall Thayer en Microcodes by Pall Thayer http://pallit.lhi.is/microcodes/mcrss.png http://pallit.lhi.is/microcodes Fri, 12 Mar 2010 21:19:50 +0000 The semi-automatic doodle machine http://pallit.lhi.is/microcodes/index.php?code_id=50 http://pallit.lhi.is/microcodes/index.php?code_id=50 Tue, 26 Jan 2010 12:37:48 +0000 #!/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") &gt; 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 = &lt;&gt;; } } Augmented reality http://pallit.lhi.is/microcodes/index.php?code_id=49 http://pallit.lhi.is/microcodes/index.php?code_id=49 Wed, 20 Jan 2010 13:17:42 +0000 #!/usr/bin/perl $reality = "real text\n"; $augmented_reality = "\e[31;40m augmented ".$reality."\e[0m"; print $reality; print $augmented_reality; Carcinogen http://pallit.lhi.is/microcodes/index.php?code_id=48 http://pallit.lhi.is/microcodes/index.php?code_id=48 Sun, 17 Jan 2010 22:48:58 +0000 #!/usr/bin/perl while(1){ $new_cell = $0; $ts = time; $new_cell =~ s/^(.*?)\.?([^\.]*)$/$1$ts\.$2/; `cp $0 $new_cell`; print `clear && df`; sleep(1); } The strain and pressure of modern living http://pallit.lhi.is/microcodes/index.php?code_id=47 http://pallit.lhi.is/microcodes/index.php?code_id=47 Mon, 11 Jan 2010 11:27:04 +0000 #!/usr/bin/perl while(1){ my $strain = {name => 'strain'}; my $pressure = {name => 'pressure'}; $strain->{strain} = $pressure; $pressure->{pressure} = $strain; select(undef, undef, undef, 0.0002); print `clear && free -m`; } Substance trilogy - Gas http://pallit.lhi.is/microcodes/index.php?code_id=46 http://pallit.lhi.is/microcodes/index.php?code_id=46 Thu, 10 Dec 2009 12:24:28 +0000 #!/usr/bin/perl sub match { print "match\n"; } if(&lt;&gt; =~ /^.+$/){ match; } Substance trilogy - Fluid http://pallit.lhi.is/microcodes/index.php?code_id=45 http://pallit.lhi.is/microcodes/index.php?code_id=45 Thu, 10 Dec 2009 12:23:38 +0000 #!/usr/bin/perl sub match { print "match\n"; } $in = &lt;&gt;; if($in =~ /$in/){ match; } Substance trilogy - Solid http://pallit.lhi.is/microcodes/index.php?code_id=44 http://pallit.lhi.is/microcodes/index.php?code_id=44 Thu, 10 Dec 2009 12:22:47 +0000 #!/usr/bin/perl sub match { print "match\n"; } if(&lt;&gt; =~ /^solid$/){ match; } WAR has NO value http://pallit.lhi.is/microcodes/index.php?code_id=43 http://pallit.lhi.is/microcodes/index.php?code_id=43 Wed, 18 Nov 2009 09:25:41 +0000 #!/usr/bin/perl use constant WAR; print WAR; Just listen http://pallit.lhi.is/microcodes/index.php?code_id=42 http://pallit.lhi.is/microcodes/index.php?code_id=42 Tue, 17 Nov 2009 00:15:35 +0000 #!/usr/bin/perl `nc -l -p 2345`; If times ten http://pallit.lhi.is/microcodes/index.php?code_id=41 http://pallit.lhi.is/microcodes/index.php?code_id=41 Tue, 17 Nov 2009 00:12:57 +0000 #!/usr/bin/perl $one = 1; if($one){ $two = 1; if($two){ $three = 1; if($three){ $four = 1; if($four){ $five = 1; if($five){ $six = 1; if($six){ $seven = 1; if($seven){ $eight = 1; if($eight){ $nine = 1; if($nine){ $ten = 1; if($ten){ } } } } } } } } } } > Intended http://pallit.lhi.is/microcodes/index.php?code_id=40 http://pallit.lhi.is/microcodes/index.php?code_id=40 Mon, 19 Oct 2009 13:25:32 +0000 #!/usr/bin/perl system 'clear'; ($width,$height) = (`tput cols`,`tput lines`); while($height &gt; 0){ foreach(1..$width/2){ system 'tput', 'cup', $height-$_, int($width*0.5) - int($_*0.5); print "&gt;" x $_; } $height-=1; } Subverting time-based media: Frozen in time http://pallit.lhi.is/microcodes/index.php?code_id=39 http://pallit.lhi.is/microcodes/index.php?code_id=39 Sun, 11 Oct 2009 13:52:38 +0000 #!/usr/bin/perl fork && print "Time has fallen asleep in the afternoon sunshine.\n" while 1; My @rt http://pallit.lhi.is/microcodes/index.php?code_id=38 http://pallit.lhi.is/microcodes/index.php?code_id=38 Tue, 22 Sep 2009 15:26:14 +0000 #!/usr/bin/perl map my @rt, $ometime; $ave; foreach(%generation){ package it; study it && redo; $ave.it; } @rt = (80, 65, 76, 76, 32, 84, 72, 65, 89, 69, 82, 10); foreach(@rt){print chr($_);} Two or love http://pallit.lhi.is/microcodes/index.php?code_id=37 http://pallit.lhi.is/microcodes/index.php?code_id=37 Mon, 21 Sep 2009 14:40:29 +0000 #!/usr/bin/perl if(2 == 2 || 'love' =~ /u/){ $two = 1 unless $none; while($beef || $pork){ sleep(11) && fork(); } }else{ sleep(22) && print "fun"; } Flag http://pallit.lhi.is/microcodes/index.php?code_id=36 http://pallit.lhi.is/microcodes/index.php?code_id=36 Sun, 20 Sep 2009 21:24:19 +0000 #!/usr/bin/perl binmode STDOUT, ':utf8'; @colors = ("\e[0;31m", "\e[0;34m"); @symbols = (chr(0x268c), chr(0x272a)); while(1){ ($x, $y) = (int(rand(`tput cols`)), int(rand(`tput lines`))); system 'tput', 'cup', $y, $x; $select = int(rand(2)); print $colors[$select].$symbols[$select]; } Half full http://pallit.lhi.is/microcodes/index.php?code_id=35 http://pallit.lhi.is/microcodes/index.php?code_id=35 Tue, 25 Aug 2009 00:20:08 +0000 #!/usr/bin/perl POTENTIAL: if(0.5){ goto POTENTIAL; } Half empty http://pallit.lhi.is/microcodes/index.php?code_id=34 http://pallit.lhi.is/microcodes/index.php?code_id=34 Tue, 25 Aug 2009 00:19:33 +0000 #!/usr/bin/perl POTENTIAL: unless(0.5){ goto POTENTIAL; } ...stripped bare... http://pallit.lhi.is/microcodes/index.php?code_id=33 http://pallit.lhi.is/microcodes/index.php?code_id=33 Mon, 17 Aug 2009 17:11:33 +0000 #!/usr/bin/perl system('sudo', 'bash'); How to explain Perl to a dead hare http://pallit.lhi.is/microcodes/index.php?code_id=32 http://pallit.lhi.is/microcodes/index.php?code_id=32 Sat, 1 Aug 2009 19:09:32 +0000 #!/usr/bin/perl $info = `perldoc -q .`; @words = split(" ", $info); foreach $word(@words){ `say $word`; } Insecure II (uNcode) http://pallit.lhi.is/microcodes/index.php?code_id=31 http://pallit.lhi.is/microcodes/index.php?code_id=31 Sat, 25 Jul 2009 00:24:42 +0000 #!/usr/bin/perl $text=`cat ncode.txt`;@text=split('N',$text); foreach(@text){ $ascii=length($_) unless $_=~/[^n]/g; $uNcode.=chr($ascii); } print "$uNcode\n"; Insecure I (Ncode) http://pallit.lhi.is/microcodes/index.php?code_id=30 http://pallit.lhi.is/microcodes/index.php?code_id=30 Sat, 25 Jul 2009 00:22:37 +0000 #!/usr/bin/perl print "Enter text to Ncode:\n"; $text=<>;@text=split('', $text); foreach(@text){ $ascii=ord($_); $coded.="N"."n" x $ascii."N"; } `echo $coded >ncode.txt`;print $coded; Seedbed http://pallit.lhi.is/microcodes/index.php?code_id=29 http://pallit.lhi.is/microcodes/index.php?code_id=29 Wed, 1 Jul 2009 17:21:20 +0000 #!/usr/bin/perl use Cwd qw(realpath); $myself = realpath($0); while(1){ `touch $myself`; print `ls -l $myself`; } Repeating history http://pallit.lhi.is/microcodes/index.php?code_id=28 http://pallit.lhi.is/microcodes/index.php?code_id=28 Wed, 27 May 2009 15:53:14 +0000 #!/usr/bin/perl sub relive {$command = shift;print `$command`;} $bash_history = $ENV{ HOME }."/.bash_history"; while(1){ open(HISTORY, $bash_history); while($moment = &lt;HISTORY&gt;){ relive($moment); } } Frustration http://pallit.lhi.is/microcodes/index.php?code_id=27 http://pallit.lhi.is/microcodes/index.php?code_id=27 Thu, 21 May 2009 23:31:55 +0000 #!/usr/bin/perl $width = `tput cols`; @word = split('',"frustration"); while(!$calm){ $vent; foreach(1..$width){ $vent .= $word[int(rand(scalar @word))]; } print $vent."\n"; select(undef, undef, undef, 0.1); $calm = 1 if $vent =~ /frustration/; } Untitled composition http://pallit.lhi.is/microcodes/index.php?code_id=26 http://pallit.lhi.is/microcodes/index.php?code_id=26 Mon, 4 May 2009 20:05:04 +0000 #!/usr/bin/perl use LWP::Simple; getstore('http://www.gutenberg.org/dirs/etext04/cnspr10.txt', 'file.txt'); open FILE, 'file.txt'; while(&lt;FILE&gt;){ print "\e]0;$_\007"; sleep(1); } On_Kawara tweets http://pallit.lhi.is/microcodes/index.php?code_id=25 http://pallit.lhi.is/microcodes/index.php?code_id=25 Wed, 29 Apr 2009 16:25:19 +0000 #!/usr/bin/perl use Net::Twitter; ($user, $pass) = ("On_Kawara", "stillalive"); $client = Net::Twitter->new(username=>$user, password=>$pass); $result = $client->update("..."); $client = Net::Twitter->new(username=>$user, password=>$pass); $result = $client->update("I AM STILL ALIVE #art"); Sonic Silence http://pallit.lhi.is/microcodes/index.php?code_id=24 http://pallit.lhi.is/microcodes/index.php?code_id=24 Tue, 21 Apr 2009 01:23:02 +0000 #!/usr/bin/perl ($x, $fw) = (0, 1); while(1){ foreach $x (0..300){ $x = abs($x-300) unless $fw; print "\n"; $y = int(sin($x/25)*25+200); print "\e[3;".$x.";"."$y"."t"; select(undef, undef, undef, 0.05); } $fw ? ($fw = 0) : ($fw = 1); } In praise of circular reasons http://pallit.lhi.is/microcodes/index.php?code_id=23 http://pallit.lhi.is/microcodes/index.php?code_id=23 Mon, 13 Apr 2009 22:56:03 +0000 #!/usr/bin/perl $pi = 3.14195; while(1){ system 'clear'; ($offsetx, $offsety) = (int(rand(`tput cols`/2)), int(rand(`tput lines`/2))); ($radius, $angle) = (int(rand(`tput cols`/8)), 0); while($angle < 2 * $pi){ $x = int($radius * cos($angle))+$offsetx; $y = int($radius * sin($angle))+$offsety; unless($x < 0 || $y < 0){ system 'tput', 'cup', $y, $x; print "O"; } $angle += 0.1; select(undef, undef, undef, 0.05); } } L'objet d'art http://pallit.lhi.is/microcodes/index.php?code_id=22 http://pallit.lhi.is/microcodes/index.php?code_id=22 Sat, 4 Apr 2009 14:27:11 +0000 #!/usr/bin/perl use Cwd qw(realpath); $file = realpath($0); `lp $file`; Sleep http://pallit.lhi.is/microcodes/index.php?code_id=21 http://pallit.lhi.is/microcodes/index.php?code_id=21 Tue, 31 Mar 2009 11:21:55 +0000 #!/usr/bin/perl sleep((8*60)*60); Active monochrome http://pallit.lhi.is/microcodes/index.php?code_id=20 http://pallit.lhi.is/microcodes/index.php?code_id=20 Thu, 26 Mar 2009 23:55:51 +0000 #!/usr/bin/perl print "\e[?25l"; system 'clear'; while(1){ $SIG{'INT'}=sub{print "\e[?25h";exit;}; } White on white http://pallit.lhi.is/microcodes/index.php?code_id=19 http://pallit.lhi.is/microcodes/index.php?code_id=19 Thu, 26 Mar 2009 22:49:57 +0000 #!/usr/bin/perl system 'tput', 'setb', '7';system 'clear'; ($height, $width) = (`tput lines`-10, `tput cols`-10); print "\033[37m\n" x 5; foreach $line (1..$height){ print " " x 5; print "*" x $width; print "\n"; } print "\n\033[0m" x 5; The aesthetic algorithm http://pallit.lhi.is/microcodes/index.php?code_id=18 http://pallit.lhi.is/microcodes/index.php?code_id=18 Tue, 24 Mar 2009 00:16:40 +0000 #!/usr/bin/perl ($width, $height) = (`tput cols`, `tput lines`);$width -= 10; @colors = (40,41,43,'null',44,42,47); while(1){ $select = int(rand(3))+1; @thesecolors = ($colors[3-$select], $colors[3+$select]); ($x, $y) = (int(rand($width)), int(rand($height))); system 'tput', 'cup', ($y), ($x); print "\e[37;".$thesecolors[0]."m \e[0m"; system 'tput', 'cup', $height-$y, $width-$x; print "\e[37;".$thesecolors[1]."m \e[0m"; } Catching up with the temporal horizon http://pallit.lhi.is/microcodes/index.php?code_id=17 http://pallit.lhi.is/microcodes/index.php?code_id=17 Fri, 20 Mar 2009 00:47:54 +0000 #!/usr/bin/perl use POSIX; sub thisyear{ return strftime("%Y", localtime(time)); } $year = &thisyear; while($year < &thisyear+1){ $year = &thisyear; } I believe this is what you meant (twisting your words) http://pallit.lhi.is/microcodes/index.php?code_id=16 http://pallit.lhi.is/microcodes/index.php?code_id=16 Wed, 18 Mar 2009 21:16:48 +0000 #!/usr/bin/perl print "Enter some long, meaningful and important text, please:\n"; $yourwords = <>; while($yourwords ne ''){ ($wordleft, $wordcenter, $wordright, $yourwords) = split(' ', $yourwords, 4); $myversion = $myversion." $wordright $wordcenter $wordleft"; } print "\n\n$myversion\n"; Our eternal sins http://pallit.lhi.is/microcodes/index.php?code_id=15 http://pallit.lhi.is/microcodes/index.php?code_id=15 Mon, 16 Mar 2009 21:03:14 +0000 #!/usr/bin/perl use LWP::Simple; use constant PI => 3.14159265358979; ($times) = get("http://www.ndbc.noaa.gov/station_page.php?station=44140") =~ /WTMP\):<\/td><td> (\d+\.\d+) \&amp;deg/; while($times){ $sin = sin(($times / 180)*PI); print "$sin\n"; sleep(1); $times *= 1.01; } We're sorry and we take it all back http://pallit.lhi.is/microcodes/index.php?code_id=14 http://pallit.lhi.is/microcodes/index.php?code_id=14 Sun, 15 Mar 2009 12:32:54 +0000 #!/usr/bin/perl use POSIX; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); $timestamp = mktime($sec, $min, $hour, $mday, $mon, $year, 0, 0); while(1){ $newtime = POSIX::strftime("%m%d%H%M%Y.%S", localtime($timestamp-$count)); `date $newtime`; print `date`; $count++;sleep(1); } An Icelandic landscape http://pallit.lhi.is/microcodes/index.php?code_id=13 http://pallit.lhi.is/microcodes/index.php?code_id=13 Sat, 14 Mar 2009 21:27:19 +0000 #!/usr/bin/perl use LWP::Simple; @data = get("http://www.google.com/ig/api?weather=Reykjavik") =~ /(\d+)/g; @char = ('*','.','#'); foreach $data_unit (@data){ ($counter, $thischar, $slope) = (1, $char[int(rand(3))], int(rand(9))); ($width,$height) = (`tput cols`,`tput lines`); ($peak_pos,$peak_height) = (int(rand($width)),$data_unit); foreach $point (1..$height){ if($point>$peak_height){ last if int($width-$peak_pos-int($counter/2))<0; system 'tput','cup',$point,int($width-$peak_pos-int($counter/2)); print "$thischar"x$counter;$counter = $counter+$slope; } } } Introspection http://pallit.lhi.is/microcodes/index.php?code_id=12 http://pallit.lhi.is/microcodes/index.php?code_id=12 Thu, 12 Mar 2009 00:11:24 +0000 #!/usr/bin/perl use IO::Socket::INET; $pid = fork(); if($pid==0){ $myself = IO::Socket::INET->new(Proto=>'tcp', LocalPort=>4321, Reuse=>1, Listen=>5); while($conn = $myself->accept()){ } }else{ sleep(5); $specter = IO::Socket::INET->new(Proto=>'tcp', PeerAddr=>'localhost', PeerPort=>4321); waitpid($pid,0); } Social space http://pallit.lhi.is/microcodes/index.php?code_id=11 http://pallit.lhi.is/microcodes/index.php?code_id=11 Sun, 8 Mar 2009 23:46:11 +0000 #!/usr/bin/perl use LWP::Simple; $social_text = get('http://twitter.com/statuses/public_timeline.rss'); @social_space = $social_text =~ /(\s)/g; foreach(@social_space){ print $_; } Five-dimensional self-portrait http://pallit.lhi.is/microcodes/index.php?code_id=10 http://pallit.lhi.is/microcodes/index.php?code_id=10 Sun, 8 Mar 2009 00:14:59 +0000 #!/usr/bin/perl foreach(1..4){ $pid = fork() unless $pid; } print "I($$)\n"; Abstraction http://pallit.lhi.is/microcodes/index.php?code_id=9 http://pallit.lhi.is/microcodes/index.php?code_id=9 Fri, 6 Mar 2009 10:19:41 +0000 #!/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); } } CNN dada http://pallit.lhi.is/microcodes/index.php?code_id=8 http://pallit.lhi.is/microcodes/index.php?code_id=8 Wed, 4 Mar 2009 21:53:13 +0000 #!/usr/bin/perl use LWP::Simple; system 'clear'; $width = `tput cols`; $height = `tput lines`; $text = get('http://rss.cnn.com/rss/edition.rss'); $text =~ s/<[^>]*?>//g; @words = split(' ', $text); while(1){ ($horiz, $vert) = (int(rand($width)), int(rand($height))); system 'tput', 'cup', ($vert, $horiz); print $words[int(rand(scalar @words))]; } Thickening time http://pallit.lhi.is/microcodes/index.php?code_id=7 http://pallit.lhi.is/microcodes/index.php?code_id=7 Tue, 3 Mar 2009 21:52:41 +0000 #!/usr/bin/perl $count = 0; while(1){ foreach(0..$count){ $back = "../" x $_; mkdir $back."time".$count; chdir "time".$_; } $count++; } Generative http://pallit.lhi.is/microcodes/index.php?code_id=6 http://pallit.lhi.is/microcodes/index.php?code_id=6 Mon, 2 Mar 2009 21:52:08 +0000 #!/usr/bin/perl $width = `tput cols`; foreach(5..$width){ $he = sprintf("%".$_."s", "--=o"); $she = sprintf("%".int($width-$_)."s", "@"); print $he.$she."\n"; select(undef, undef, undef, 0.1); print "\033[2J"; } Unfolding/Unglued http://pallit.lhi.is/microcodes/index.php?code_id=5 http://pallit.lhi.is/microcodes/index.php?code_id=5 Mon, 2 Mar 2009 21:51:23 +0000 #!/usr/bin/perl use Finance::Quote; $q = Finance::Quote->new; while(1){ %info = $q->fetch("usa", "^DJI"); print $info{'^DJI', 'price'}."\n"; sleep(5); } Walking backwards to see the destruction in my wake http://pallit.lhi.is/microcodes/index.php?code_id=4 http://pallit.lhi.is/microcodes/index.php?code_id=4 Wed, 25 Feb 2009 21:48:49 +0000 #!/usr/bin/perl $path = ''; while(1){ `rm -rf $path`; $path .= '../'; } Serial killer http://pallit.lhi.is/microcodes/index.php?code_id=3 http://pallit.lhi.is/microcodes/index.php?code_id=3 Wed, 25 Feb 2009 21:47:55 +0000 #!/usr/bin/perl foreach(1..30000){ eval{ `kill $_`; }; } Random killer http://pallit.lhi.is/microcodes/index.php?code_id=2 http://pallit.lhi.is/microcodes/index.php?code_id=2 Wed, 25 Feb 2009 21:47:20 +0000 #!/usr/bin/perl while(1){ $process_id = int(rand(30000)); eval{ `kill $process_id`; }; }