3 # This program is free software: you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation, either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 my @restaurant_list = (
22 '4S Ranch (Outside Patio)',
29 'California Pizza Kitchen',
30 'Cheeburger Cheeburger',
34 'Daphne\'s Greek Cafe',
40 'Joey\'s Smokin\' BBQ',
41 'Kelly\'s Public House',
42 'King Taco Loco Donalds In-N-Out a Box Jr\'s',
43 'L&L Hawaiian Barbecue',
72 my @random_restaurant_list;
77 'silent!' => \
$quiet);
80 print "Usage: . . . \n";
85 print "Karen's Restaurant Selector\n\n";
93 my $restaurant_name = $restaurant_list[rand @restaurant_list];
95 foreach (@random_restaurant_list) {
96 if ($_ eq $restaurant_name) {
101 push @random_restaurant_list, $restaurant_name;
103 if($pick == scalar @random_restaurant_list) {
107 # If we have tried to pick restaurant twice as many times as asked and
108 # still don't have enough, just exit.
109 if($num_of_loops >= $pick * 2) {
115 @random_restaurant_list = sort @random_restaurant_list;
116 my $num_restaurants = scalar @random_restaurant_list;
117 for(my $i = 0; $i < $num_restaurants; $i++) {
118 print $random_restaurant_list[$i];
119 if($i + 1 != $num_restaurants) {