R
Robin
#!/usr/bin/perl
use Tk;
$m = new MainWindow ();
my $t1 = 400;
$c = $m -> Canvas (-width=>$t1, -height=>400, -background=>"black") ->
pack ();
$l = $m -> Label (-text=>"Write sentences to invade and release good
guys at the same time") -> pack ();
$t = $m -> Scrolled ("Text") -> pack ();
$t -> bind ("<a>", \&d);
$t -> bind ("<u>", \&d);
$t -> bind ("<e>", \&d);
$t -> bind ("<i>", \&d);
$t -> bind ("<o>", \&d);
MainLoop ();
sub d () {
my $e = int rand ($t1);
my $e2 = int rand ($t1);
my $e3 = int rand ($t1);
my $e4 = int rand ($t1);
$c -> create ("rectangle", $e, $e2, $e3, $e4, -outline=>"red");
my $e = int rand ($t1);
my $e2 = int rand ($t1);
my $e3 = int rand ($t1);
my $e4 = int rand ($t1);
$c -> create ("rectangle", $e, $e2, $e3, $e4, -outline=>"black");
my $e = int rand ($t1);
my $e2 = int rand ($t1);
my $e3 = int rand ($t1);
my $e4 = int rand ($t1);
$c -> create ("rectangle", $e, $e2, $e3, $e4, -outline=>"black");
if ($e == 50 or $e == 50 or $e == 301 or $e == 100) {
$z += 1;
$c -> create ("rectangle", $e, $e2, $e3, $e4, -outline=>"yellow");
$l -> configure (-text=>"Your score is $z\n");
}
if ($z == 200) {
$m -> Dialog (-text=>"You win. Now write about what the screen
looked like.") -> Show ();
exit ();
}
}
use Tk;
$m = new MainWindow ();
my $t1 = 400;
$c = $m -> Canvas (-width=>$t1, -height=>400, -background=>"black") ->
pack ();
$l = $m -> Label (-text=>"Write sentences to invade and release good
guys at the same time") -> pack ();
$t = $m -> Scrolled ("Text") -> pack ();
$t -> bind ("<a>", \&d);
$t -> bind ("<u>", \&d);
$t -> bind ("<e>", \&d);
$t -> bind ("<i>", \&d);
$t -> bind ("<o>", \&d);
MainLoop ();
sub d () {
my $e = int rand ($t1);
my $e2 = int rand ($t1);
my $e3 = int rand ($t1);
my $e4 = int rand ($t1);
$c -> create ("rectangle", $e, $e2, $e3, $e4, -outline=>"red");
my $e = int rand ($t1);
my $e2 = int rand ($t1);
my $e3 = int rand ($t1);
my $e4 = int rand ($t1);
$c -> create ("rectangle", $e, $e2, $e3, $e4, -outline=>"black");
my $e = int rand ($t1);
my $e2 = int rand ($t1);
my $e3 = int rand ($t1);
my $e4 = int rand ($t1);
$c -> create ("rectangle", $e, $e2, $e3, $e4, -outline=>"black");
if ($e == 50 or $e == 50 or $e == 301 or $e == 100) {
$z += 1;
$c -> create ("rectangle", $e, $e2, $e3, $e4, -outline=>"yellow");
$l -> configure (-text=>"Your score is $z\n");
}
if ($z == 200) {
$m -> Dialog (-text=>"You win. Now write about what the screen
looked like.") -> Show ();
exit ();
}
}