Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

matra555's scratchpad

by matra555 (Monk)
on Jan 04, 2005 at 00:27 UTC ( [id://419110]=scratchpad: print w/replies, xml ) Need Help??

just for fun...(requires Unix):

#!/usr/bin/perl use strict; use warnings; my $f = `fortune`; chomp(my $w = `echo \$USER`); print "\nHello, $w! Your fortune for today is:\n\n $f\n";
Here is a small MUD-esque movement thing I made:

#!/usr/bin/perl use strict; use warnings; my $state = 1; my @exits = ("Major Motoko Kusanagi wishes you well!","Come back soon, + ya hear?","Bah, coward!","Go with God.","Stellaaaaaa!","Namo Kuan Yi +n."); sub welcome { print "Welcome to my game! Do you want to move:\n\n"; print "North?\n"; print "South?\n"; print "East?\n"; print "West?\n\n"; } sub movement { while ($state == 1) { welcome(); print "<120/120hps 50/50mana 100/100mvs> "; chomp(my $move = <STDIN>); if ($move =~ /^(north|south|east|west)$/i) { print "\nYou have moved $move.\n\n"; } elsif ($move =~ /^(halt|quit|exit)$/i) { print "\n$exits[rand @exits]\n\n"; $state = 0; } else { print "\nThat is not a valid option.\n\n"; } } } movement();
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-10-14 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.