-
Notifications
You must be signed in to change notification settings - Fork 2
/
map.pl
29 lines (28 loc) · 1.16 KB
/
map.pl
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
# **************************************************************************** #
# #
# ::: :::::::: #
# map.pl :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ajordan- <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/07/01 12:43:50 by ajordan- #+# #+# #
# Updated: 2021/07/01 12:44:01 by ajordan- ### ########.fr #
# #
# **************************************************************************** #
#!/usr/bin/perl
use warnings;
use strict;
die "program x y density" unless (scalar(@ARGV) == 3);
my ($x, $y, $density) = @ARGV;
print "$y.ox\n";
for (my $i = 0; $i < $y; $i++) {
for (my $j = 0; $j < $x; $j++) {
if (int(rand($y) * 2) < $density) {
print "o";
}
else {
print ".";
}
}
print "\n";
}