#!/usr/bin/perl #################### VARIABLES ######################### # fifty fifty $blockWidth=3; $blockHeight=3; $canvasWidth=12; $canvasHeight=7; $blockCharDk="#"; $blockCharLt=" "; # directory ###################################### # ask: print "Choose One:\n"; print "1.Fifty-Fifty\n"; print "2.new, testing\n"; print "READY > "; chomp($choice=); print "\n"; # go: &fifty_fifty() if ($choice == 1); &test() if ($choice == 2); sub fifty_fifty { foreach (1..$canvasHeight){ $pattern = $blockCharDk x $blockWidth . $blockCharLt x $blockWidth if ($flip); $pattern = $blockCharLt x $blockWidth . $blockCharDk x $blockWidth unless ($flip); $pattern2 = $pattern x $canvasWidth . "\n"; print $pattern2 x $blockHeight; $flip=$flip ? "" : "t"; } } sub test { print "test"; }