#!/usr/local/bin/perl -w #Values will be stored if the data values equate to them being stored #outside these limits, but they will not be displayed or properly maintained. $WIDTH = 8; $HEIGHT = 5; #where the central brick is located, always on the first line. $OFFSET = 3; $BRICK_SIZE = 5; #C64 Column size; this is how the shapes are stored. $COLUMN_SIZE = 40; $BRICK = "O"; $NOT_A_BRICK = "·"; sub erase_shape{ for ($jj = 0; $jj < $HEIGHT; $jj++) { for ($kk = 0; $kk < $WIDTH; $kk++) { $shape[$jj][$kk] = $NOT_A_BRICK; } } $shape_numbers = ""; $shape[0][$OFFSET] = $BRICK; } #erase_shape $ii = 0; $shape_amt = 0; erase_shape(); while (<>) { /.*data(.*)/; @bricks = split(',', $1); foreach $brick (@bricks) { #move everything over about 5 spaces to center it in #char array. $brick += $OFFSET; $shape[($brick / $COLUMN_SIZE)][($brick % $COLUMN_SIZE)] = $BRICK; $shape_numbers .= "$brick "; #print "$brick "; #Larry's pre-compiler sd catch this, so its all good. $ii = ($ii + 1) % ($BRICK_SIZE - 1); if ($ii eq 0) { $shape_amt++; for ($jj = 0; $jj < $HEIGHT; $jj++) { for ($kk = 0; $kk < $WIDTH; $kk++) { print $shape[$jj][$kk]; } #for print "\n"; } #for print "$shape_amt: $shape_numbers\n\n"; erase_shape(); } #if } #foreach print "\n"; } #while