Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

My random project generator

by esk555 (Beadle)
on Nov 16, 2006 at 04:32 UTC ( #584361=CUFP: print w/replies, xml ) Need Help??

It's sparse, short, cryptic, and perhaps not very unique,

but someone might find this useful. I like to think it

taps into the unlimited chaotic potential of Perl. Here's

the code.


#!/usr/bin/perl use strict; use warnings; my @words = ("copy ","study ","meditate ","write from scratch "); my @words2 = ("and ","or "); my @words3 = ("scalars ","arrays ","hashes ","regexes ","subroutines " +,"cpan ","perlmonk archives ","cgi "); print $words[rand @words], $words2[rand @words2], $words[rand @words], + $words3[rand @words3], "\n";

Replies are listed 'Best First'.
Re: My random project generator
by b10m (Vicar) on Nov 16, 2006 at 09:09 UTC

    IMHO, it'd be better to take out the elements you've used, for now I get things as:

    write from scratch or write from scratch perlmonk archives
    study or study hashes
    write from scratch or write from scratch arrays

    Something like this would fix it (/me ducks for TIMTOWTDI attacks...)

    print splice(@words, int rand @words, 1), $words2[int rand @words2], splice(@words, int rand @words, 1), $words3[int rand @words3],"\n";
    --
    b10m

    All code is usually tested, but rarely trusted.
      Alright, I know how I'm going to be populating my ~/.plan from now on... (:


      strfry( $vegetables )
Re: My random project generator
by dewey (Pilgrim) on Nov 16, 2006 at 07:07 UTC
    This is a very simple bit of code but I like the effect. It's sort of quiet and unassuming. I may post a 'remix' later... in a little snippet like this I like to play a lot with syntactical and formatting possibilities. Thanks for posting!
    ~dewey

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://584361]
Approved by Moriarty
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2022-07-03 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?