Old 02-26-2007, 04:47 AM   #1 (permalink)
Banned
 
TwitcH's Avatar
 
Join Date: May 2006
Posts: 2,053
Reputation: 14
Default The Coding Challenge #1

Well I've been thinking of ways to get this section livened up and decided to throw a few challenges your way

The idea is I throw a programming problem/challenge at you guys and you get 1 week (need more?) to post your solutions in whatever language you like. Once everyone has submitted there program they will each be reviewed and marked on various things (not quite worked out the scoring yet, bare with me on that).

The winner's code will be put on display in a "Hall Of Fame" sticky for the world to see

So yeah, first challenge will be semi-simple, not too hard, not too easy, so here go's:
(Please if you think this is too difficult tell me and I will change it)

Challenge #1: The Chat

Your challenge is to simulate a chat between 2 chatroom users (it can look like msn, irc.. anything like that).

It has to look like the words are being typed onto the screen 1 at a time.

The chat must be at least 10 lines long.

Extra points for adding some color/graphics and humor

An example output would be something like:

Code:
* j0hnny (john@irc-6B140240.ip-pool.nefkom.net) has joined #chat
<j0hnny> sup guys
<sexygurl123> hi
<j0hnny> wanna cyb0r?
<sexygurl123> sure
<j0hnny> oooh ahhh yeah thats good
<sexygurl123> oh ya harder faster
<j0hnny> k im done
But it has to look like each letter is being typed right in front of your eyes.

If you guy's don't like the idea please say so, so I don't have to work out how I'm gonna be scoring this thing

Good Luck!

(Remember, you have 1 week, if you think that is not enough PLEASE SAY SO NOW!)

EDIT:

Also, If you have a better way to make the same challenge better/easier/harder then just post it and we'll see about making changes, this 1st challenge is more of a concept challenge so all of your ideas WILL be taken into account in the Coding Challenge #2, so if you want this thing to kick off please contribute your idea's now.

EDIT 2:

Here's what I got so far, hopefully it will inspire people to have a go ^^

Code:
#include <stdio.h>
#include <unistd.h>
int main (void) {
        char *ptr = "Hello, World";
        for (int i = 0; *(ptr + i); i++) {
                putchar(*(ptr+i));
                fflush(stdout);
                usleep(500000);
}
putchar('\n');
}
This will print "Hello, World" 1 letter at a time with a 0.5 second delay.

This a bit difficult for the first ever challenge?

Last edited by TwitcH; 02-26-2007 at 03:43 PM.
TwitcH is offline  
Old 02-26-2007, 03:35 PM   #2 (permalink)
SuperKenshin's Servent
 
AtomSlap's Avatar
 
Join Date: Nov 2006
Posts: 1,028
Reputation: 32
Default

Aha!
People do listen to me!

Anyways, I'll post (not edit) the answer to challenge #1 later on today.

Thanks man, hopefully this should inspire n00bs in researching

If anyone needs help with this, PM me for my eMail, and I'll give you some tips.

Very odd...

EDIT: I thought I had it easy but my code keeps on getting errors...hmm...

Give me till tomorrow, I'll be home from work at 4: 30, should be done by 6.

This post was 20% info, and 80% bump
I don't think enough people have seen this thread.

Last edited by AtomSlap; 02-26-2007 at 10:46 PM. Reason: -=Doublepost=-
AtomSlap is offline  
Old 02-26-2007, 10:42 PM   #3 (permalink)
Dante’s Inferno
 
naruto1327's Avatar
 
Join Date: May 2006
Location: OLD PROFILE. NEW: NOODLEPOWA
Posts: 608
Reputation: 10
Send a message via AIM to naruto1327 Send a message via MSN to naruto1327 Send a message via Yahoo to naruto1327
Default

=O

Do we upload the executable file and post the link here, post the source code, or do we post a screenshot?

EDIT: Good idea btw.

EDIT 2: Oh, and does this have to be cross-platform?

EDIT 3: Sorry about all the edits ... I have a question though, can it be in a scripting language, like JavaScript?

Last edited by naruto1327; 02-27-2007 at 01:46 AM. Reason: Questions :P
naruto1327 is offline  
Old 02-27-2007, 12:29 AM   #4 (permalink)
Sun? What Sun?
 
Dennis56's Avatar
 
Join Date: Aug 2006
Location: дома
Posts: 951
Reputation: 10
Default

Shouldn't be to hard in php.. but it would be more of a challenge in python since i am not as good so ill see if i can get in in about 5 days when i have sometime

PS: Can we give hints?
Dennis56 is offline  
Old 02-27-2007, 01:32 AM   #5 (permalink)
Orc's Breathmint
 
Join Date: Jul 2006
Posts: 103
Reputation: 10
Default

My submission
Thank you naruto1327 for telling me about this!

http://thebar.ej.am/misc/onrpg.html

A real conversation I had with my friend about his over 80 year old French teacher...


--- how many can we submit? if more than one, I wanna try this in java, php, javascript, c#, and w/e else I can think of xD!
__________________



Last edited by XceeD; 02-27-2007 at 01:46 AM. Reason: looks better on html
XceeD is offline  
Old 02-27-2007, 03:59 AM   #6 (permalink)
Crumbly, but Good
 
Eriond's Avatar
 
Join Date: May 2006
Location: Montreal
Posts: 1,646
Reputation: 67
Send a message via MSN to Eriond
Default

Quote:
Originally Posted by naruto1327 View Post
=O

Do we upload the executable file and post the link here, post the source code, or do we post a screenshot?

EDIT: Good idea btw.

EDIT 2: Oh, and does this have to be cross-platform?

EDIT 3: Sorry about all the edits ... I have a question though, can it be in a scripting language, like JavaScript?
If you're going to post an EXE, please post the source code. Viruses are a dime a dozen these days...
__________________
Outsider
3D Space Action Shooter/RPG in Development
http://www.youtube.com/user/outsidergame
Eriond is online now  
Old 02-27-2007, 05:42 AM   #7 (permalink)
Banned
 
TwitcH's Avatar
 
Join Date: May 2006
Posts: 2,053
Reputation: 14
Default

Quote:
Originally Posted by XceeD View Post
My submission
Thank you naruto1327 for telling me about this!

http://thebar.ej.am/misc/onrpg.html

A real conversation I had with my friend about his over 80 year old French teacher...


--- how many can we submit? if more than one, I wanna try this in java, php, javascript, c#, and w/e else I can think of xD!
Submit as many as you like, but by the end of the week you must pick which one you will submit for scoring in the final submission thread I will make, this way people can post there code in this thread and get some pointers from other people on how to make it better, then they can resubmit in the final thread.

And as for posting executables, I'm not too sure on that, I would prefer you post the source code with instructions on compiling, but I'm sure people could be trusted here to post executables, just don't hold me responsible if you get rooted ^^

XceeD, nice code by the way ^^

And all of you remember, if you have any idea's on how scoring is going to work please post them, I dont know if I should be scoring based on the source code or the compiled product.

Anyways, keep it up guy's, you got till 12am Sunday GMT.

Quote:
Originally Posted by naruto1327 View Post
=O

Do we upload the executable file and post the link here, post the source code, or do we post a screenshot?

EDIT: Good idea btw.

EDIT 2: Oh, and does this have to be cross-platform?

EDIT 3: Sorry about all the edits ... I have a question though, can it be in a scripting language, like JavaScript?
1: Thanks, but not my idea. ;]

2: Nope, my example code up there is linux, best thing I can think of is comment the code well so people can see what is going on if they dont have the OS to compile it on.

3: Of course. Like I said, any language. Just make sure it's impressive. ;]

Last edited by TwitcH; 02-27-2007 at 05:47 AM. Reason: -=Doublepost=-
TwitcH is offline  
Old 02-27-2007, 06:41 AM   #8 (permalink)
Link's Dirty Sock
 
Gobla's Avatar
 
Join Date: Feb 2007
Posts: 45
Reputation: 10
Default

I'm in .

2 questions:
- 1 program or a server-side and client-side program?
- Is a multi-user chat okay?

As for scoring. Use rates from 1 to 10. Give 8 objectives. 2 other points can be gotten through adding extras.

so for example:
- Handling server disconnects - 1 point
- 10 lines of chat - 1 point
- custom names ( not predefined ones ) - 1 point
- user list - 1 point
- 100% bug free - 1 point
- chat is shown as if it's typed - 1 point
- something else - 1 point
- something else - 1 point
- cool extra feature - 1 point
- cool extra feature - 1 point

cool extra features would for example be adding fonts/colours or smileys. The possibility to store a text file detailing the entire conversation etc.
Gobla is offline  
Old 02-27-2007, 06:46 AM   #9 (permalink)
Staff Admin
 
lothia's Avatar
 
Join Date: May 2006
Location: Kent Washington
Posts: 5,213
Reputation: 29
Send a message via AIM to lothia Send a message via MSN to lothia Send a message via Skype™ to lothia
Default

Wait so can you just use a timer to slowly type out each letter and have it look like it pushed enter or am I thinking incorrect? Like did I read it wrong.
__________________


Moderator since Aug 2004. I am a guy.
Email me at lothia@gmail.com
FFXI Tsukisa: 60pld/30War (retired)
The OnRPG War
lothia is online now  
Old 02-27-2007, 09:33 AM   #10 (permalink)
Link's Dirty Sock
 
Gobla's Avatar
 
Join Date: Feb 2007
Posts: 45
Reputation: 10
Default

Quote:
Originally Posted by lothia View Post
Wait so can you just use a timer to slowly type out each letter and have it look like it pushed enter or am I thinking incorrect? Like did I read it wrong.
You can basically do it 2 ways I think.

Send a complete message and then have a timer type it out.

Send every letter as soon as they are typed and when enter is pressed you go to a new chat line.
Gobla is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:02 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0
OnRPG, Copyright ©2003-2011, Game Entertainment Enterprises