Programming Challenges
Moderator: Moderators
-
joevennix
- Portablizer
- Posts: 999
- Joined: Sat Jan 14, 2006 9:34 am
- Location: On permanent vacation from reality.
Programming Challenges
I've been on this forum for a while, and it seems like nearly half or so of the "core" members know at least one programming language. I've been into java for around a year, and do a bit of C++, so even I know a bit.
Recently I've been doing a few local programming competitions, where you are put on a team of 3, with one computer only, and you have to write programs to complete the tasks required. So I'm thinking, maybe we could get something like that going on here. I'll post a problem, and you all could submit your source code via PM. The code can be java, C++, or VB (if I can recruit another person to help compile and judge). I'll post the correct programs and answer any questions in this topic.
If you want to help judge C++ or VB, PM me. I think I can handle java by myself. As a judge, you'll need to be able to write an efficient, clean answer to each problem, which will be displayed after the competition. You'll also have to compile and run each example of submitted code, and make sure it completes each test.
What do you all think? Good/bad idea?
Recently I've been doing a few local programming competitions, where you are put on a team of 3, with one computer only, and you have to write programs to complete the tasks required. So I'm thinking, maybe we could get something like that going on here. I'll post a problem, and you all could submit your source code via PM. The code can be java, C++, or VB (if I can recruit another person to help compile and judge). I'll post the correct programs and answer any questions in this topic.
If you want to help judge C++ or VB, PM me. I think I can handle java by myself. As a judge, you'll need to be able to write an efficient, clean answer to each problem, which will be displayed after the competition. You'll also have to compile and run each example of submitted code, and make sure it completes each test.
What do you all think? Good/bad idea?
-
joevennix
- Portablizer
- Posts: 999
- Joined: Sat Jan 14, 2006 9:34 am
- Location: On permanent vacation from reality.
Yeah alright Sky, I personally know Java is way over your head.Skyone wrote:I could judge any of the three... but I'd much rather compete!
As a judge, you'll be coding the answers to the challenges. Your code will serve as a model for others, so it will have to be as clear and clean as possible. So, if you look at it that way, writing judge-standard code is actually more difficult than just submitting code.
unfortunately I only know BASIC (qBASIC at that), some VB 2005, but I know bash shell best. I don't think you want to look at the first and last, both really hurt your eyes and brain to figure out.
The idea is sound and I like it. If I had more experience I'd just in head first, suicidal as that is.
The idea is sound and I like it. If I had more experience I'd just in head first, suicidal as that is.
vskid wrote:Nerd = likes school, does all their homework, dies if they don't get 100% on every assignment
Geek = likes technology, dies if the power goes out and his UPS dies too
I am a geek.
-
bicostp
- Moderator
- Posts: 10491
- Joined: Mon Mar 07, 2005 5:47 pm
- Steam ID: bicostp
- Location: Spamalot
- Contact:
I copyz Skyone <img src="http://benheck.com/phpBB/images/smiles/icon_razz.gif">
Green: Great
Orange: Intermediate
Red: Basic
Brown: All I can do is "Hello World"
Green: Great
Orange: Intermediate
Red: Basic
Brown: All I can do is "Hello World"
VB.NET 2003/2005
QuickBasic
TI-BASIC
DOS batch
PHP
JavaScript
ASP
Commodore BASIC
C++
ActionScript 2.0 (Flash 8)
ActionScript 1.0 (Flash MX)
Last edited by bicostp on Mon May 07, 2007 9:01 pm, edited 1 time in total.
Twitter
http://www.pcwgaming.com" onclick="window.open(this.href);return false;
If you want a Dropbox account, please use my referral link
http://www.pcwgaming.com" onclick="window.open(this.href);return false;
If you want a Dropbox account, please use my referral link
-
Gamelver
- Moderator
- Posts: 3352
- Joined: Sun Apr 04, 2004 9:03 pm
- Location: in my basement, to forever work on portables ;)
I've been taking Java for a year now at school....
What kind of problems were you thinking of? How about posting an example (for Java, at least
)? If they seem possible to do with what I know of Java I might enter
.
What kind of problems were you thinking of? How about posting an example (for Java, at least
Without games my life would have no meaning.
Well, I guess it would, but it would be a lot less fun!!!!!!!

Well, I guess it would, but it would be a lot less fun!!!!!!!

-
atari2600a
- Posts: 1330
- Joined: Fri Jul 28, 2006 12:42 am
- Location: Schwarzeneggerville, CA
- Contact:
I know 6502 ASM, & very little BASIC & C.
<a href="http://pokerapizzle.ytmnd.com/">YTMND: The Pokerap!</a>
<a href="http://mtac.profusehost.net/">http://mt ... st.net/</a>
<a href="http://mtac.profusehost.net/forum/index.php">MTAC Forums!</a>
<a href="http://mtac.profusehost.net/">http://mt ... st.net/</a>
<a href="http://mtac.profusehost.net/forum/index.php">MTAC Forums!</a>
-
joevennix
- Portablizer
- Posts: 999
- Joined: Sat Jan 14, 2006 9:34 am
- Location: On permanent vacation from reality.
Alright, well I'm glad this thread has made it this far. As for judging, are there any volunteers? I can't do this all by myself, especially in the VB categories. Also, if no one is really interested in coding C/C++, it can be dropped.
From this I'd like to establish a set of rules.
1. All programs will use only the console/terminal for input/output. No GUI stuff.
2. Submittors are kept on the honor code to not plagiarize. Implementing a small block of code found through research is one thing, but turning in someone else's source code isn't.
On that note, anyone want to judge?
Okay, here's the sort of program I'd propose (this one is pretty difficult, but can be pulled off. It definitely took me a while, but that's not saying much):Gamelver wrote:What kind of problems were you thinking of? How about posting an example (for Java, at least)? If they seem possible to do with what I know of Java I might enter
.
Code: Select all
Create a class called RomanConverter that will take in a regular, Arabic number, and output it in Roman numeral form. Input will be an integer greater than 0 and less than 2500. Hopefully this will help:
RN Number
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Sample input/output:
Enter Arabic number: 152
Equivalent Roman numeral: CLII
1. All programs will use only the console/terminal for input/output. No GUI stuff.
2. Submittors are kept on the honor code to not plagiarize. Implementing a small block of code found through research is one thing, but turning in someone else's source code isn't.
On that note, anyone want to judge?
-
gannon
- Moderator
- Posts: 6974
- Joined: Sun Apr 04, 2004 4:48 pm
- Location: Near that one big lake
- Contact:
Well, not really a supported language, but I'm a bit bored:
Now, it'll turn it into a numeral, but it's only about halfway done so it's a dumb output (doesn't detect 4 being IV, etc) 
Code: Select all
<?php
function read() {
$fp = fopen('php://stdin','r');
$line = fgets($fp, 4);
fclose($fp);
return trim($line);
}
function numeralizer($int) {
if (!preg_match('/^\d+$/', $int) || $int <= 0 || $int > 2500) return false;
$int_str = '';
while ($int > 0) {
if ($int >= 1000) {
$int_str .= 'M';
$int -= 1000;
} elseif ($int >= 500) {
$int_str .= 'D';
$int -= 500;
} elseif ($int >= 100) {
$int_str .= 'C';
$int -= 100;
} elseif ($int >= 50) {
$int_str .= 'L';
$int -= 50;
} elseif ($int >= 10) {
$int_str .= 'X';
$int -= 10;
} elseif ($int >= 5) {
$int_str .= 'V';
$int -= 5;
} elseif ($int >= 1) {
$int_str .= 'I';
$int -= 1;
}
}
return $int_str;
}
$output = numeralizer(read());
echo (($output === false || $output == '') ? 'Input invalid or an error occured' : $output)."\n";
?>