1 Programming Contest #1 - Calculator Tue Feb 15, 2011 9:18 pm
The Professor
Contributor
Likewise, I've decided to start hosting programming contests with spare time. The reason for this is not only to challenge others, but to challenge myself as well. Now then, let's get to it.
Contest:
The user who writes a calculator with the least amount of code wins.
Reward:
x3 +rep
FAQ:
Q. What language can I use?
A. Any computer language.
Q. What functionality does my calculator have to pertain?
A. As long as your calculator is able to do basic arithmetic, it qualifies. Convenience is not the key aspect of this contest.
Rules:
No Plagiarism, doing so will result in an immediate disqualification and temporary ban from Computer Talks.
Deadline is February 21, 2011.
You can PM me your work or post it here.
I REPEAT, DO NOT SEND ME AN EXECUTABLE OR I WILL KILL YOU. Not really, it just won't qualify.
: 3
Bonus:
Anyone able to write a smaller calculator than mine will receive x5 +rep.
---------------------------------------------------------------------------------------------------------------
Now start your engines people!
My Calculator (Written in Perl):
Pastebin: [You must be registered and logged in to see this link.]
Contest:
The user who writes a calculator with the least amount of code wins.
Reward:
x3 +rep
FAQ:
Q. What language can I use?
A. Any computer language.
Q. What functionality does my calculator have to pertain?
A. As long as your calculator is able to do basic arithmetic, it qualifies. Convenience is not the key aspect of this contest.
Rules:
No Plagiarism, doing so will result in an immediate disqualification and temporary ban from Computer Talks.
Deadline is February 21, 2011.
You can PM me your work or post it here.
I REPEAT, DO NOT SEND ME AN EXECUTABLE OR I WILL KILL YOU. Not really, it just won't qualify.
: 3
Bonus:
Anyone able to write a smaller calculator than mine will receive x5 +rep.
---------------------------------------------------------------------------------------------------------------
Now start your engines people!
My Calculator (Written in Perl):
- Code:
#!/usr/bin/perl
BEGIN { print("##### Protozoid's Calculator ##### \n" . "\n") }
print("Select Your Operation: Addition, Subtraction, Multiplication, or Division. \n");
$operation = <STDIN>;
chomp($operation);
print("Select Factor One: ");
$factor1 = <STDIN>;
chomp($factor1);
print("Select Factor Two: ");
$factor2 = <STDIN>;
chomp($factor2);
if ($operation eq "Addition") {
print("Result: ");
print($factor1 + $factor2 . "\n");
}
elsif ($operation eq "Subtraction") {
print("Result: ");
print($factor1 - $factor2 . "\n");
}
elsif ($operation eq "Multiplication") {
print("Result: ");
print($factor1 * $factor2 . "\n");
}
elsif ($operation eq "Division") {
print("Result: ");
print($factor1 / $factor2 . "\n");
}
else {
print("Invalid operation specified! Please make sure to note that the operations are case-sensitive, please state them according to the example given. \n")
}
END { print("Protozoid's Calculator is now terminated... \n") }
Pastebin: [You must be registered and logged in to see this link.]