Maze 2008: Sample Program

0404.pl - faulty!


#!/usr/bin/perl

# Prepare a new terminal screen
require Term::Screen;
$silly_var=new Term::Screen;
$silly_var->clrscr();

# Get the contents of the map file
open (MF, "< maze04.map");
@the_map_that_was_in_the_file_on_disk = ;
close (MF);

# Force the fracking lines into the the_actual_maze_that_i_will_use mit einer kleiner shosen hornen
@the_actual_maze_that_i_will_use="";
foreach $l (@the_map_that_was_in_the_file_on_disk)
{
  push @the_actual_maze_that_i_will_use, [$l];
}

# Who's got my little man. Give me back my little man. Gimme, gimme, gimme back my man in the corner
for ($y=0;$y<=20;$y++)
{
 for ($x=0;$x<=40;$x++)
  {
    $silly_var->at($y,$x)->puts("$the_actual_maze_that_i_will_use[$y][$x]");
    if ($the_actual_maze_that_i_will_use[$y][$x] == "@")
    {
      $thar_she_blows_left=$x;
      $thar_she_blows_down=$y;
    }
  }
}

$silly_var->at($y+1,0)->puts("Player is at Y: $thar_she_blows_down X: $thar_she_blows_left");
$silly_var->at($y+2,0)->puts("");