Thread: score tracker
View Single Post
  #8   Spotlight this post!  
Unread 04-01-2003, 21:03
evulish's Avatar
evulish evulish is offline
1010100
AKA: Grant Harding
#0084 (WATTNESS (bot: Chuck))
Team Role: Alumni
 
Join Date: Jul 2002
Location: Towanda/Wysox, PA
Posts: 1,434
evulish is just really niceevulish is just really niceevulish is just really niceevulish is just really nice
Send a message via AIM to evulish
Code:
#!/usr/bin/perl

#mehh

print "Largest stack of alliance 1: ";
$a1stack = <>;
print "All other alliance 1 boxes: ";
$a1box = <>;
print "Number of alliance 1 bots on top part of goal: ";
$a1bot = <>;


#alliance 2

print "Largest stack of alliance 2: ";
$a2stack = <>;
print "All other alliance 2 boxes: ";
$a2box = <>;
print "Number of alliance 2 bots on top part of goal: ";
$a2bot = <>;


$a1score = ($a1stack * $a1box) + (25 * $a1bot);
$a2score = ($a2stack * $a2box) + (25 * $a2bot);
print "--------\nScores:\n Alliance 1: $a1score\n Alliance 2: $a2score\n";

if ($a1score > $a2score) { $ht = 1; $hs = $a1score; $ls = $a2score; }
else { $h2 = 2; $hs = $a2score; $ls = $a1score; }

$qpw = ($ls * 2) + $hs;

print "Alliance $ht Wins!\nQualifying points for winner: $qpw\nLoser: $ls";

Do I get a prize or something? I guess I could make sure they actually typed numbers in there...and make sure those numbers are correct...

Bah. That means extra work for me
__________________
I'm a professional web developer. I'm good with PHP, Perl, Java/JSP, some RoR, XML, Javascript (AJAX as well), (x)HTML, CSS, etc.. Validated code is good; fully cross-browser code is better (you comply to your users and the software they use, not the other way around. Sorry!)