Programming Challenges

Want to just shoot the breeze? Forum 42 is the place!

Moderator: Moderators

joevennix
Portablizer
Posts: 999
Joined: Sat Jan 14, 2006 9:34 am
Location: On permanent vacation from reality.

Programming Challenges

Post by joevennix »

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?
Image
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

I could judge any of the three... but I'd much rather compete! :P
gannon
Moderator
Posts: 6974
Joined: Sun Apr 04, 2004 4:48 pm
Location: Near that one big lake
Contact:

Post by gannon »

I've done ruby, php, perl, c, c++, javascript, & basic, but I only have good knowledge in php and javascript (haven't used the rest in awhile :P)
joevennix
Portablizer
Posts: 999
Joined: Sat Jan 14, 2006 9:34 am
Location: On permanent vacation from reality.

Post by joevennix »

Skyone wrote:I could judge any of the three... but I'd much rather compete! :P
Yeah alright Sky, I personally know Java is way over your head. :D

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.
Image
Kurt_
Portablizer
Posts: 5748
Joined: Thu Nov 24, 2005 10:32 am
Steam ID: kurbert
Location: Ontario, Canada
Contact:

Post by Kurt_ »

I can do some VB, to compete. I've been called the best in the school, but I think that's just because everyone here sucks at it, because I can't even pull data from a text file.
Hey, sup?
Sparkfist
Forum Administrator
Posts: 6754
Joined: Tue Apr 20, 2004 7:12 am
Location: Michigan

Post by Sparkfist »

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.
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.
Harshboy
Portablizer
Posts: 3610
Joined: Tue Oct 11, 2005 3:44 pm

Post by Harshboy »

Kurt_ wrote:I can't even pull data from a text file.
LMAO!


I can do VB 6 and Ruby (in RGSS Varient)
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

I winz. :P

Green: Great
Orange: Intermediate
Red: Basic

  • VB6
    C
    C#
    C++

    Java
    PHP
    BASIC
    Delphi
    Assembly (16 and 32-bit)
    PERL
    Ruby
    Python
    Game Maker Language (lol)
    Dark BASIC
bicostp
Moderator
Posts: 10491
Joined: Mon Mar 07, 2005 5:47 pm
Steam ID: bicostp
Location: Spamalot
Contact:

Post by bicostp »

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"

  • 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.
Neildo_64
Portablizer
Posts: 852
Joined: Sun Jan 29, 2006 9:09 pm
Location: Iowa

Post by Neildo_64 »

I know a little C, C#, C++, VB, Assembler, and COBOL, but probably not as much as you guys. I would say my best are HTML (lol. Great with html), COBOL, and C++. It sounds like a great idea.
Image
Current projects:
Ultimate N64 Guide
N64 Portable (x2)
NES Portable
Gamelver
Moderator
Posts: 3352
Joined: Sun Apr 04, 2004 9:03 pm
Location: in my basement, to forever work on portables ;)

Post by Gamelver »

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 :P)? If they seem possible to do with what I know of Java I might enter :).
Without games my life would have no meaning.
Well, I guess it would, but it would be a lot less fun!!!!!!!

Image
atari2600a
Posts: 1330
Joined: Fri Jul 28, 2006 12:42 am
Location: Schwarzeneggerville, CA
Contact:

Post by atari2600a »

I know 6502 ASM, & very little BASIC & C.
joevennix
Portablizer
Posts: 999
Joined: Sat Jan 14, 2006 9:34 am
Location: On permanent vacation from reality.

Post by joevennix »

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.
Gamelver wrote:What kind of problems were you thinking of? How about posting an example (for Java, at least :P)? If they seem possible to do with what I know of Java I might enter :).
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):

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
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?
Image
gannon
Moderator
Posts: 6974
Joined: Sun Apr 04, 2004 4:48 pm
Location: Near that one big lake
Contact:

Post by gannon »

Well, not really a supported language, but I'm a bit bored:

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";
?>
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) :P
Skyone
Moderator
Posts: 6390
Joined: Tue Nov 29, 2005 8:35 pm
Location: it is a mystery
Contact:

Post by Skyone »

joevennix wrote:1. All programs will use only the console/terminal for input/output. No GUI stuff.
Do you even know what VB is? :P
Post Reply