additional symlink cleanup
[aymargeddon/current.git] / src / debug.pl
1 #!/usr/local/bin/perl -w
2 ##########################################################################
3 #
4 #   Copyright (c) 2003 Aymargeddon Development Team
5 #
6 #   This file is part of "Last days of Aymargeddon" 
7 #
8 #   Aymargeddon is free software; you can redistribute it and/or modify it
9 #   under the terms of the GNU General Public License as published by the Free
10 #   Software Foundation; either version 2 of the License, or (at your option)
11 #   any later version.
12 #
13 #   Aymargeddon is distributed in the hope that it will be useful, but WITHOUT
14 #   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 #   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
16 #   more details.
17 #   You should have received a copy of the GNU General Public License along
18 #   with this program; if not, write to the Free Software Foundation, Inc., 675
19 #   Mass Ave, Cambridge, MA 02139, USA. 
20 #
21 ###########################################################################
22 #
23
24 #
25 #
26 # creates the world to destroy
27 #
28 # usage: ./create.pl [number of eartlings]
29 #
30 #
31
32 # TODO: use FROGS/DataBase.pm instead of DBI.pm
33
34 use strict;
35
36 use DBI;
37 use Data::Dumper;
38 use POSIX qw(floor ceil);
39 use Term::ReadLine;
40
41 use FROGS::HexTorus;
42
43 my $n = 16;
44 my $map = new HexTorus($n);
45 my $out = "\n";
46 for my $y (0..($n - 1)){
47   for my $x ( 0 .. ($n*2-1)){
48
49     my $d =
50       $map->distance(Location->new(5,0),
51                            Location->new($x,$y));
52     $d = "0$d" if $d < 10;
53     $out .= "$d ";
54   }
55   $out .= "\n" . (' ' x ($y +1));
56 }
57 $out .= "\n";
58
59 print $out;