in reply to Re: Creating a random generator
in thread Creating a random generator
#!/usr/bin/perl use strict; use warnings; my $beholder = 'beholder'; my $book = 'Monstrous Manual'; #default book my @gen = ( 'beholder', 'death kiss', 'eye of the deep', 'gauth', 'spectator', 'undead', 'hive mother', 'director', 'examiner', 'lensman', 'overseer', 'watcher', 'Monstrous Manual', ); my %pg = ( 'beholder' => 21, 'death kiss' => 21, 'eye of the deep' => 21, 'gauth' => 21, 'spectator' => 21, 'undead' => 21, 'hive mother' => 25, 'director' => 25, 'examiner' => 25, 'lensman' => 25, 'overseer' => 25, 'watcher' => 25, ); my $section = $gen[rand @gen]; my $page = $pg{$section}; print "$section $beholder (<i>$book</i>, pg $page) \n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Creating a random generator
by Lady_Aleena (Priest) on Sep 08, 2007 at 08:28 UTC | |
by wfsp (Abbot) on Sep 08, 2007 at 09:06 UTC | |
by Lady_Aleena (Priest) on Sep 08, 2007 at 11:09 UTC | |
by wfsp (Abbot) on Sep 08, 2007 at 11:45 UTC | |
by Lady_Aleena (Priest) on Sep 08, 2007 at 13:09 UTC | |
|