C Board  

Go Back   C Board > Community Boards > Contests Board

Reply
 
LinkBack Thread Tools Display Modes
Old 05-16-2006, 01:55 PM   #1
Anti-Poster
 
Join Date: Feb 2002
Posts: 1,212
Contest - Snake Numbers

It's been a while since a contest has been posted. Here's a fairly simple one.

Write a function that can play Snake Numbers, leaving the fewest number of squares. The rules for Snake Numbers are simple:
  • The board is an 18x18 square of numbers ranging from 1-6. There are 5 bombs randomly placed on the board. The starting location is random on each board.
  • The object is to eliminate as many squares as possible by travelling over them.
  • On each turn, the snake head must go in one of eight directions (any of the cardinal or ordinal directions). The snake head travels a number spaces equal to the value of the square adjacent to the snake head in the chosen direction. The snake leaves a tail behind on all squares travelled over.
  • If the snake travels over a bomb, its tail, or one of the sides of the board, the game is over.

Before I start spouting off stuff about entries and judging, is there any interest in this contest?

[edit]See rules below.[/edit]
__________________
Rule #1: Every rule has exceptions

Traveller's Dilemma Contest Site - Results posted!

Last edited by pianorain; 05-17-2006 at 09:42 AM.
pianorain is offline   Reply With Quote
Old 05-16-2006, 03:32 PM   #2
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
Yea I would participate. Looks like a good challange.



PS. For those wondering about the Texas Holdem, it's still coming, I just got real busy at work.
__________________
SWinC - Simple Windows Class
Darryl is offline   Reply With Quote
Old 05-16-2006, 03:41 PM   #3
Even death may die...
 
Dante Shamest's Avatar
 
Join Date: Apr 2003
Location: Malaysia
Posts: 970
I'd participate.
Dante Shamest is offline   Reply With Quote
Old 05-16-2006, 05:48 PM   #4
Registered User
 
Join Date: May 2006
Location: Troy
Posts: 14
Sure, but have the game run over stdin and stdout, not some class. And, um, specify a wide set of options for the programming language to use. (Including Scheme :-). Or else I'll write Scheme code and then compile it to incomprehensible C++.)
Rash is offline   Reply With Quote
Old 05-17-2006, 05:04 AM   #5
The superheterodyne.
 
twomers's Avatar
 
Join Date: Dec 2005
Location: Ireland
Posts: 2,205
I'll do it ... I will wait till my exams are finished though, so that's about 10 days from now. When will it start? Sounds like a good one!!
__________________
I blag!
twomers is offline   Reply With Quote
Old 05-17-2006, 07:58 AM   #6
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
Quote:
Originally Posted by Rash
Sure, but have the game run over stdin and stdout, not some class. And, um, specify a wide set of options for the programming language to use. (Including Scheme :-). Or else I'll write Scheme code and then compile it to incomprehensible C++.)
The problem with allowing many programming languages is that most people don't want to accept binaries and don't want to have to support compiling a whole mess of different languages. Besides this is a C/C++ programming forum.
__________________
SWinC - Simple Windows Class
Darryl is offline   Reply With Quote
Old 05-17-2006, 09:40 AM   #7
Anti-Poster
 
Join Date: Feb 2002
Posts: 1,212
Snake Numbers Contest

Schedule / Deadline
Start Date: May 17th, 2006
End Date: June 14th, 2006

Submissions
If you choose to enter, please reply stating that you have entered the contest, and before the Contest deadline you must enter a submission that meets the stated requirements and send it to the submission officer via email or private message. E-mail is preferred.

E-mail: pianorain@bellsouth.net
PM: pianorain

Introduction
Write a function that can play Snake Numbers, leaving the fewest number of squares. The rules for Snake Numbers are simple:
  • The board is an 18x18 square of numbers ranging from 1-6. There are 5 bombs randomly placed on the board. The starting location is random on each board.
  • The object is to eliminate as many squares as possible by travelling over them.
  • On each turn, the snake head must go in one of eight directions (any of the cardinal or ordinal directions). The snake head travels a number spaces equal to the value of the square adjacent to the snake head in the chosen direction. The snake leaves a tail behind on all squares travelled over.
  • If the snake travels over a bomb, its tail, or one of the sides of the board, the game is over.

Details
Entries will be accepted in C, C++, or C#. Fill free to create and submit additional helper functions and methods.

C
Write a function that matches the following prototype:
Code:
void SnakeNumbers(int board[18][18], enum Direction moveList[318]);
board will contain values ranging from 1-6 (normal squares), SNAKE_HEAD, SNAKE_TAIL, and BOMB. You should fill moveList with the sequence of moves from the starting position. The last move should be 0 (or Empty).
Use the following header file: snake_c.h
C++
Write a function that matches the following prototype:
Code:
void SnakeNumbers(int board[18][18], std::vector<Direction>& moveList);
board will contain values ranging from 1-6 (normal squares), SNAKE_HEAD, SNAKE_TAIL, and BOMB. You should fill moveList with the sequence of moves from the starting position.
Use the following header file: snake_cpp.h
C#
Write a class that implements the following interface:
Code:
public interface ISnakeNumbers
{
	Collection<Direction> SnakeNumbers(int[,] board);
}
board will contain values ranging from 1-6 (normal squares), SnakeNumbers.SnakeHead, SnakeNumbers.SnakeTail, and SnakeNumbers.Bomb. The return value should contain the sequence of moves from the starting position.
Use the following code file: SnakeCSharp.txt
Contest Rules
Below are the current contest rules and regulations.

I. Official Rules
I.I You may only submit one entry per contest, and it must have been submitted between the contest start and end dates.

I.II Entries submitted should be:
  • Substantially the developer's original design
  • Substantially the developer's original programming
  • In C, C++, or C#

II. Code Judging
II.I Submitted code will be judged based on the following:

Compiliation (0 - 5 x5)
How easy it is to compile. Warnings detract from this score.

Success x 5 (0.0 - 10.0)
Each entry will be given five boards to solve. This will be graded depending upon how well the code performs the desired task.

Time x 5 (0.0 - 10.0)
Each entry will be given five boards to solve. This will be graded depending upon how fast the code performs the desired task compared to the other entries.

Coding Style(0 - 5 x5)
Code efficiency, is the code readable? Are good programming practices followed? (Are processes closed when finished, do you use arrays when initializing multiple variables under one instance, and do you free memory after allocation?)

Best Code Score: 150.0

Contest outline borrowed from Stack Overflow. IMO, his outline should be sticked or something; it looks good and provides a clean start for people starting a contest.
__________________
Rule #1: Every rule has exceptions

Traveller's Dilemma Contest Site - Results posted!
pianorain is offline   Reply With Quote
Old 05-17-2006, 01:03 PM   #8
Tropical Coder
 
Darryl's Avatar
 
Join Date: Mar 2005
Location: Cayman Islands
Posts: 503
I'm in.

Quote:
Compiliation (0 - 5 x5)
How easy it is to compile. Warnings detract from this score.
Ok based on this statement, it might help to know what compiler you will use.
__________________
SWinC - Simple Windows Class
Darryl is offline   Reply With Quote
Old 05-17-2006, 01:15 PM   #9
Registered User
 
Join Date: Jan 2005
Posts: 847
I'm in too.
Quantum1024 is offline   Reply With Quote
Old 05-17-2006, 01:30 PM   #10
Anti-Poster
 
Join Date: Feb 2002
Posts: 1,212
Quote:
Originally Posted by Darryl
Ok based on this statement, it might help to know what compiler you will use.
I'll be compiling with Microsoft Visual Studio 2005.
__________________
Rule #1: Every rule has exceptions

Traveller's Dilemma Contest Site - Results posted!
pianorain is offline   Reply With Quote
Old 05-17-2006, 02:12 PM   #11
Even death may die...
 
Dante Shamest's Avatar
 
Join Date: Apr 2003
Location: Malaysia
Posts: 970
Quote:
Originally Posted by pianorain
I'll be compiling with Microsoft Visual Studio 2005.
Is it reliable?
Dante Shamest is offline   Reply With Quote
Old 05-17-2006, 02:26 PM   #12
Anti-Poster
 
Join Date: Feb 2002
Posts: 1,212
I've not had any problems with it. :shrug:

[edit] On the other hand, I've got 2003 and VS 6 installed too, so if any problems pop-up, I can use those also.
__________________
Rule #1: Every rule has exceptions

Traveller's Dilemma Contest Site - Results posted!

Last edited by pianorain; 05-17-2006 at 02:33 PM.
pianorain is offline   Reply With Quote
Old 05-17-2006, 03:16 PM   #13
Registered User
 
Join Date: Jan 2005
Posts: 847
As is mentioned in that thread using standard c functions can produce a lot of warnings dose that count?
Quantum1024 is offline   Reply With Quote
Old 05-17-2006, 05:01 PM   #14
Anti-Poster
 
Join Date: Feb 2002
Posts: 1,212
No. Like I said, it hasn't given me any problems. Including that define turns all of those warnings off.
__________________
Rule #1: Every rule has exceptions

Traveller's Dilemma Contest Site - Results posted!
pianorain is offline   Reply With Quote
Old 05-18-2006, 03:32 AM   #15
The superheterodyne.
 
twomers's Avatar
 
Join Date: Dec 2005
Location: Ireland
Posts: 2,205
But, you could always download Dev or something, and test it in that ... where I don't think the errors occur. But, it's never givenme any problems either!
__________________
I blag!
twomers is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Logical errors with seach function Taka C Programming 4 09-18-2006 05:20 AM
Contest Results - Snake Numbers pianorain Contests Board 4 06-22-2006 09:14 AM
linked list problem kzar C Programming 8 02-05-2005 04:16 PM
the definition of a mathematical "average" or "mean" DavidP A Brief History of Cprogramming.com 7 12-03-2002 11:15 AM


All times are GMT -6. The time now is 08:28 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22