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: [email protected]
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.