~johanvandegriff/unix-shell-programming-revised-edition-programs

unix-shell-programming-revised-edition-programs/maze/makemaze.pl -rw-r--r-- 633 bytes
fc214385Johan Vandegriff added other old scripts, some newer ones too 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/perl

use warnings;
use strict;

my @saved = ();
my @current = ();

my $filename = "/home/johanv/programs/maze/maze.txt" ;

open(LOCATION, $filename) or die "Cannot open $filename: $!\n";
my $top_dir = <LOCATION>;
close(LOCATION);

mkdir $top_dir/maze

$filename = "$top_dir/maze.txt"

open(FILE, $filename) or die "Cannot open $filename: $!\n";
while ( <FILE> ) {
  # set each item of @current to each letter of $_
  # for each item of @current:
  #   if the item is an X:
  #     read from @saved
  #   otherwise:
  #     overwrite that item of @saved from @current
  # make a directory based on @current
}
close(FILE);