#!/usr/bin/perl
use lib '.';
require "pagelib.pl";
header();
head();

$dir = "images/dodec";
if(!opendir(DIR,$dir)) {
    print "Internal error locating images!<br>\n";
}
@files = readdir(DIR);
foreach(@files) { push @images,$1 if(/(dodec\d+)\.jpg/); }
%used = ();

print qq`
<br><br>
<B><font size=+1>Dodecahedron</font></B><br>
<br>
So, while playing around one day, I found that the small 2x3 wedge plates can
come ever so close to a 108 degree angle, which is needed to create a perfect
pentagon. The plates actually form a 108.43 degree angle, which (apparently)
is close enough to fudge a little :)<br>
<br>
The rest was simple-- although I constructed it slightly larger than
theoretically needed, just so it would be easier to handle. This one takes up
600 pieces and 120 grey little wedge plates (the only color I had enough of
them in!)<br>
`;

show_images(@images);

foot();

sub show_images {
    my(@pics) = @_;
    my($i) = 0;
    print "<table width=100\%><tr>\n";
    foreach(sort @pics) {
	next if($used{$_});
	$used{$_} = 1;
	if(!($i++%4)) {
	    print "</tr>\n<tr>\n";
	}
	print "<td align=center><a href=\"$dir/$_.jpg\"><img src=\"$dir/$_\_th.jpg\" border=0></a></td>\n";
    }
    print "</tr></table>\n";
}
