Jump to content

Coding challenge


snakey

Recommended Posts

Ok i had an idea to have say weekly/monthly coding challenges that anyone could enter and are run by the community so here goes.

OK the structure is simple:

One person makes a challenge.

Anyone who want to can complete the challenge.

To enter you must post the source codes and a working exe.

The person who made the challenge deciedes who win then the winner makes the next challenge.

There are 3 different types of challenges Coolest app wins, First to complete, Shortest code wins.

So i'll start the first challenge as an example:

Guessing game!

Language: C++

Description: Make a small game in which the aim is to create a number at random and the user trys to guess it.

Program must have: A play again option.

Time limit: 1 week.

How to win: Coolest App Wins.

Restrictions: None.

The aim of these challenges are not to win anything but to learn and have fun so there it is so just post your code and i'll tell you who wins in a week then they can make the next challenge.

Link to comment
Share on other sites

  • Replies 237
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Ok i had an idea to have say weekly/monthly coding challenges that anyone could enter and are run by the community so here goes.

OK the structure is simple:

One person makes a challenge.

Anyone who want to can complete the challenge.

To enter you must post the source codes and a working exe.

The person who made the challenge deciedes who win then the winner makes the next challenge.

There are 3 different types of challenges Coolest app wins, First to complete, Shortest code wins.

So i'll start the first challenge as an example:

Guessing game!

Language: C++

Description: Make a small game in which the aim is to create a number at random and the user trys to guess it.

Program must have: A play again option.

Time limit: 1 week.

How to win: Coolest App Wins.

The aim of these challenges are not to win anything but to learn and have fun so there it is so just post your code and i'll tell you who wins in a week then they can make the next challenge.

Umm, I think this was already done in another thread. In fact, Klu even posted his Source Code to his Guessing game in the coding section.

There is also another challenge in progress: http://forums.hak5.org/index.php/topic,8038.0.html

Link to comment
Share on other sites

That was on K0h forums where i started it but got banned for stuff i said to him on msn so i though i'd post it here and see what happened

Getting banned from there is similar to street crime cultures view on electronic tagging. Except in this case, you usually don't do any thing wrong and the law is wrong.

Link to comment
Share on other sites

How about tightening up the "win" conditions a little? I.e. Who can do it with the least amount of lines? Who can do it without using <function that was designed to do just this task>? Who can do it in the most creative way?

Link to comment
Share on other sites

shortest way is doing it i the least amount of lines but you can just put everything in one line so the seter of the challenge can decied whos is shortest without worry about having everything squashed up. most creative is the coolest way.  i like the idea about not have certain functions i'll edit it now.

Link to comment
Share on other sites

Here is mine, not very good at C yet (taking classes for it though), so this code is prbly really slopy and could be cut down alot but it works :)

/*
  Name: randum
  Copyright: Fuck That
  Author: SableFoXx
  Date: 01/02/08 12:30
  Description: Guess the random number 1 to 10
  Version: 1.0  (working)
*/

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;

int main ()
{
  int i, x, y; //int vairables
  srand ( time(NULL) ); //time seed
  i = rand() % 10 + 1; //make randum number
    while(1)
    {
           printf ("Guess the number (1 to 10):");
           scanf ("%d",&amp;x);
           if(x==i) break;
           if (i&lt;x) puts ("Guess lower");
           else if (i&gt;x) puts ("Guess higher"); 
    }
    while(1)
    {
        printf("+++OMGz You WiN+++nn 1. Play Againn 2. Exitn ");
        scanf ("%d",&amp;y);
        if (y==1)
          {
             system("start .randum.exe"); //start over
             return 0; //exit old window
          }         
        else
        return 0; //exit
     }
}

Download compiled/source here>> http://www.mediafire.com/?flrwg1mtybu

Link to comment
Share on other sites

stablfoxx wins YAY!

Post next challenge

Because he was the only one who posted any code???

Link to comment
Share on other sites

======================================
New Coding Challange 2/3/08
======================================

Crackme
---------------------
Language: Any
Description:  Make a crackme.exe! Must accept some kinda of input, like a password etc.  Program must also tell user if the entered password is correct/incorrect.  Then also show how you cracked the password (if you can, hehe).
Time limit: 1 week
How to win: Least Chars
Link to comment
Share on other sites

Post the code, and we'll try to help you crack it.

Link to comment
Share on other sites

If i read the challenge right i might have done it properly.

#include &lt;iostream&gt;

using namespace std;

string guess;
string answer("hak");

int main(){
cout&lt;&lt;"Crack men";
cin&gt;&gt;guess;
cin.ignore();
if (guess == answer){
          cout&lt;&lt;"Correctn";
          }
else {
     cout&lt;&lt;"Wrong";
     }
     cin.get();
     }

Cracked with ollydbg

Link to comment
Share on other sites

If i read the challenge right i might have done it properly.

#include &lt;iostream&gt;

using namespace std;

string guess;
string answer("hak");

int main(){
cout&lt;&lt;"Crack men";
cin&gt;&gt;guess;
cin.ignore();
if (guess == answer){
          cout&lt;&lt;"Correctn";
          }
else {
     cout&lt;&lt;"Wrong";
     }
     cin.get();
     }

Cracked with ollydbg

Cracked with Notepad.exe, the string is stored in plain text in the executable.

Link to comment
Share on other sites

If i read the challenge right i might have done it properly.

#include &lt;iostream&gt;

using namespace std;

string guess;
string answer("hak");

int main(){
cout&lt;&lt;"Crack men";
cin&gt;&gt;guess;
cin.ignore();
if (guess == answer){
          cout&lt;&lt;"Correctn";
          }
else {
     cout&lt;&lt;"Wrong";
     }
     cin.get();
     }

Cracked with ollydbg

Nice Bro, 188 Chrs (spaces dont count)

Link to comment
Share on other sites

I actually thought something like Robocode might be fun to do as a competition.

http://robocode.sourceforge.net/

We could all make little robots in java and let them fight it out to find a winner.

Basically you write an algorythm out in java that describes the behaviour of a robot that fights other robots. After a few rounds of shooting at each other you have a winner.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...