Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Favorite Star Wars film:

by webfiend (Vicar)
on May 28, 2002 at 05:29 UTC ( #169707=note: print w/ replies, xml ) Need Help??


in reply to Favorite Star Wars film:

I had to think about this one. It took so much work to think about it that I came up with a script to help me figure it out.

my $EHH = 0; # A constant indicating indifference. my $best_time = 0; my $favorite = ""; my @episodes = what_were_the_names_again(); foreach my $movie (@episodes) { next unless (released($movie)); %scenes = watch($movie); my $opinion = $scenes{"fun"} + $scenes{"cool"} - $scenes{"awkward"} - $scenes{"midochlorians mentioned"}; if ($opinion > $best_time) { $favorite = $movie; $best_time = $opinion; } # Present a quick recap of how I felt about this episode. if ($opinion > $EHH) { print "$movie was pretty good.\n"; } elsif ($opinion == $EHH) { print "$movie was okay.\n"; } else { print "$movie kinda sucked.\n"; } } print "My favorite would have to be $favorite.\n";

I'd have to say Episode 4 was my favorite according to this logic, but a more refined approach to calculating $opinion would be in order. For example, this calculation completely ignores appearances by my favorite cranky green muppet (besides Kermit).

Oh, man. I worry about myself sometimes.

Update: Updated the commentary to match the code. Whoops.


"All you need is ignorance and confidence; then success is sure."-- Mark Twain


Comment on Re: Favorite Star Wars film:
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://169707]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2014-10-20 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (76 votes), past polls