Commit 17a20de4 authored by Sam Moore's avatar Sam Moore

Modified manager program, updated website

Major changes: Added simple GUI for human players
Setup phase doesn't use GUI yet (uses a default if -g enabled).
Click in the general region of where you want to select/move pieces.

Modified Board::Draw to allow for showing of already revealed pieces,
but not all pieces. Used to make human player GUI nicer (hides AI pieces).

Modified -t switch to allow for "infinite" stall_time
(wait for user to press enter)

Changed website. Removed protocol description and linked to manual.txt.
Added screenshot to make things slightly more exciting.
Updated manual.txt

Minor changes to simulate.py (output)

TODO:
Fix segmentation fault found in manager program
It occurs just before exit. Memory error in the cleanup process?
ANNOYING!

Still have to bring myself to take the time to finish setting up that vm...
Need to talk to a non-hostile wheel member about security. I don't want my vm to take out our network or something.

Preferably I don't even want the vm to be compromised, regardless of the rest of ucc.
So much I don't know about servers/linux...

Need to stop staying up past midnight...
parent 2120cc40
......@@ -158,9 +158,20 @@ MovementResult Controller::MakeMove(string & buffer)
}
if (Game::theGame->allowIllegalMoves && !Board::LegalResult(moveResult))
return MovementResult::OK; //HACK - Illegal results returned as legal!
else
return moveResult;
if (!Board::LegalResult(moveResult))
{
if (Game::theGame->allowIllegalMoves)
return MovementResult::OK; //HACK - Illegal results returned as legal! (Move not made)
else if (this->HumanController()) //Cut human controllers some slack and let them try again...
{
//Yes, checking type of object is "not the C++ way"
// But sometimes its bloody useful to know!!!
Message("Bad move: \'" + buffer + "\' <- Please try again!");
buffer = "";
return this->MakeMove(buffer);
}
}
return moveResult;
}
......@@ -19,7 +19,7 @@ class Controller
MovementResult MakeMove(std::string & buffer);
virtual bool HumanController() const {return false;} //Hacky... overrides in human_controller... avoids having to use run time type info
void Message(const std::string & buffer) {Message(buffer.c_str());}
virtual void Message(const char * string) = 0;
......
......@@ -404,14 +404,34 @@ MovementResult Game::Play()
MovementResult result = MovementResult::OK;
turnCount = 1;
string buffer;
Piece::Colour toReveal = reveal;
red->Message("START");
//logMessage("START\n");
while (!Board::HaltResult(result) && (turnCount < maxTurns || maxTurns < 0))
{
if (red->HumanController())
toReveal = Piece::RED;
if (printBoard)
{
system("clear");
if (turnCount == 0)
fprintf(stdout, "START:\n");
else
fprintf(stdout, "%d BLUE:\n", turnCount);
theBoard.PrintPretty(stdout, toReveal);
fprintf(stdout, "\n\n");
}
if (graphicsEnabled)
theBoard.Draw(toReveal);
turn = Piece::RED;
logMessage( "%d RED: ", turnCount);
......@@ -421,16 +441,25 @@ MovementResult Game::Play()
logMessage( "%s\n", buffer.c_str());
if (Board::HaltResult(result))
break;
if (graphicsEnabled)
theBoard.Draw(reveal);
if (stallTime > 0)
Wait(stallTime);
else
ReadUserCommand();
if (blue->HumanController())
toReveal = Piece::BLUE;
if (printBoard)
{
system("clear");
fprintf(stdout, "%d RED:\n", turnCount);
theBoard.PrintPretty(stdout, reveal);
theBoard.PrintPretty(stdout, toReveal);
fprintf(stdout, "\n\n");
}
Wait(stallTime);
if (graphicsEnabled)
theBoard.Draw(toReveal);
turn = Piece::BLUE;
logMessage( "%d BLU: ", turnCount);
......@@ -444,18 +473,13 @@ MovementResult Game::Play()
if (graphicsEnabled)
theBoard.Draw(reveal);
if (printBoard)
{
system("clear");
fprintf(stdout, "%d BLUE:\n", turnCount);
theBoard.PrintPretty(stdout, reveal);
fprintf(stdout, "\n\n");
}
Wait(stallTime);
if (stallTime > 0)
Wait(stallTime);
else
ReadUserCommand();
if (theBoard.MobilePieces(Piece::BOTH) == 0)
result = MovementResult::DRAW;
......@@ -493,6 +517,20 @@ int Game::logMessage(const char * format, ...)
return result;
}
/**
* Waits for a user command
* Currently ignores the command.
*/
void Game::ReadUserCommand()
{
fprintf(stdout, "Waiting for user to press enter...\n");
string command("");
for (char c = fgetc(stdin); c != '\n' && (int)(c) != EOF; c = fgetc(stdin))
{
command += c;
}
}
MovementResult FileController::QuerySetup(const char * opponentName, std::string setup[])
{
......@@ -538,3 +576,5 @@ MovementResult FileController::QueryMove(std::string & buffer)
buffer = string(s);
return MovementResult::OK;
}
......@@ -27,7 +27,7 @@ class Game
static void HandleBrokenPipe(int signal);
void ReadUserCommand();
const Piece::Colour Turn() const {return turn;}
void ForceTurn(const Piece::Colour & newTurn) {turn = newTurn;}
......@@ -53,7 +53,8 @@ class Game
private:
FILE * log;
Piece::Colour reveal;
public:
const Piece::Colour reveal;
int turnCount;
static bool gameCreated;
......
......@@ -13,23 +13,83 @@ MovementResult Human_Controller::QuerySetup(const char * opponentName, string se
if (!shownMessage)
{
if (graphicsEnabled)
fprintf(stderr, "GUI not yet supported! Please use CLI\n");
fprintf(stdout,"Enter %d x %d Setup grid\n", Game::theGame->theBoard.Width(), 4);
fprintf(stdout,"Please enter one line at a time, using the following allowed characters:\n");
for (Piece::Type rank = Piece::FLAG; rank <= Piece::BOMB; rank = Piece::Type((int)(rank) + 1))
fprintf(stdout, "WARNING: GUI not fully supported. You will be forced to use the default setup.\n");
else
{
fprintf(stdout,"%c x %d\n", Piece::tokens[(int)rank], Piece::maxUnits[(int)rank]);
}
fprintf(stdout, "You must place at least the Flag (%c). Use '%c' for empty squares.\n", Piece::tokens[(int)Piece::FLAG], Piece::tokens[(int)Piece::NOTHING]);
fprintf(stdout, "NOTE: Player RED occupies the top four rows, and BLUE occupies the bottom four rows.\n");
fprintf(stdout,"Enter %d x %d Setup grid\n", Game::theGame->theBoard.Width(), 4);
fprintf(stdout,"Please enter one line at a time.\n");
fprintf(stdout, "You must place at least the Flag (%c). Use '%c' for empty squares.\n", Piece::tokens[(int)Piece::FLAG], Piece::tokens[(int)Piece::NOTHING]);
switch (colour)
{
case Piece::RED:
fprintf(stdout, "You are RED and occupy the top 4 rows of the board.\n");
fprintf(stdout, "NOTE: Enter \"DEFAULT\" to use the setup:\n");
fprintf(stdout, "FB8sB479B8\nBB31555583\n6724898974\n967B669999\n");
break;
case Piece::BLUE:
fprintf(stdout, "You are BLUE and occupy the bottom 4 rows of the board.\n");
fprintf(stdout, "NOTE: Enter \"DEFAULT\" to use the setup:\n");
fprintf(stdout, "967B669999\n6724898974\nBB31555583\nFB8sB479B8\n");
break;
default:
fprintf(stdout, "WARNING: Unknown colour error! Please exit the game.\n");
break;
}
}
shownMessage = true;
}
if (graphicsEnabled)
{
switch(colour)
{
case Piece::RED:
setup[0] = "FB8sB479B8";
setup[1] = "BB31555583";
setup[2] = "6724898974";
setup[3] = "967B669999";
break;
case Piece::BLUE:
setup[0] = "967B669999";
setup[1] = "6724898974";
setup[2] = "BB31555583";
setup[3] = "FB8sB479B8";
break;
default:
assert(false);
break;
}
return MovementResult::OK;
}
for (int y = 0; y < 4; ++y)
{
cin >> setup[y];
if (y == 0 && setup[0] == "DEFAULT")
{
switch(colour)
{
case Piece::RED:
setup[0] = "FB8sB479B8";
setup[1] = "BB31555583";
setup[2] = "6724898974";
setup[3] = "967B669999";
break;
case Piece::BLUE:
setup[0] = "967B669999";
setup[1] = "6724898974";
setup[2] = "BB31555583";
setup[3] = "FB8sB479B8";
break;
default:
assert(false);
break;
}
break;
}
}
assert(cin.get() == '\n');
return MovementResult::OK;
......@@ -40,20 +100,78 @@ MovementResult Human_Controller::QueryMove(string & buffer)
static bool shownMessage = false;
if (!shownMessage)
{
if (graphicsEnabled)
fprintf(stderr, "GUI not yet supported! Please use the CLI\n");
fprintf(stdout, "Please enter your move in the format:\n X Y DIRECTION [MULTIPLIER=1]\n");
fprintf(stdout, "Where X and Y indicate the coordinates of the piece to move;\n DIRECTION is one of UP, DOWN, LEFT or RIGHT\n and MULTIPLIER is optional (and only valid for scouts (%c))\n", Piece::tokens[(int)(Piece::SCOUT)]);
if (!graphicsEnabled)
{
fprintf(stdout, "Please enter your move in the format:\n X Y DIRECTION [MULTIPLIER=1]\n");
fprintf(stdout, "Where X and Y indicate the coordinates of the piece to move;\n DIRECTION is one of UP, DOWN, LEFT or RIGHT\n and MULTIPLIER is optional (and only valid for scouts (%c))\n", Piece::tokens[(int)(Piece::SCOUT)]);
}
shownMessage = true;
}
if (graphicsEnabled)
{
fprintf(stdout, "Click to move!\n");
SDL_Event event; int mouseClick = 0;
buffer.clear();
for (char in = fgetc(stdin); in != '\n'; in = fgetc(stdin))
int x[] = {-1, -1}; int y[] = {-1, -1};
while (mouseClick < 2)
{
while (SDL_PollEvent(&event))
{
switch (event.type)
{
case SDL_QUIT:
Game::theGame->logMessage("Exit called by human player!\n");
exit(EXIT_SUCCESS);
break;
case SDL_MOUSEBUTTONDOWN:
switch (event.button.button)
{
case SDL_BUTTON_LEFT:
SDL_GetMouseState(&x[mouseClick], &y[mouseClick]);
x[mouseClick] /= 32; y[mouseClick] /= 32; //Adjust based on graphics grid size
if (mouseClick == 0)
{
stringstream s("");
s << x[0] << " " << y[0] << " ";
buffer += s.str();
}
else if (mouseClick == 1)
{
int xDist = x[1] - x[0];
int yDist = y[1] - y[0];
if (abs(xDist) > abs(yDist))
{
if (xDist < 0)
buffer += "LEFT";
else
buffer += "RIGHT";
}
else if (yDist < 0)
buffer += "UP";
else
buffer += "DOWN";
}
mouseClick++;
break;
}
break;
}
}
}
fprintf(stdout, "Move complete!\n");
}
else
{
buffer += in;
buffer.clear();
for (char in = fgetc(stdin); in != '\n'; in = fgetc(stdin))
{
buffer += in;
}
}
......
......@@ -12,9 +12,10 @@ class Human_Controller : public Controller
Human_Controller(const Piece::Colour & newColour, const bool enableGraphics) : Controller(newColour, "human"), graphicsEnabled(enableGraphics) {}
virtual ~Human_Controller() {}
virtual bool HumanController() const {return true;}
virtual MovementResult QuerySetup(const char * opponentName, std::string setup[]);
virtual MovementResult QueryMove(std::string & buffer);
virtual void Message(const char * message) {fprintf(stderr, "Recieved message \"%s\" from manager.\n", message);}
virtual void Message(const char * message) {fprintf(stderr, "%s\n", message);}
private:
const bool graphicsEnabled;
......
......@@ -75,7 +75,10 @@ Piece::Colour SetupGame(int argc, char ** argv)
fprintf(stderr, "ARGUMENT_ERROR - Expected timeout value after -t switch!\n");
exit(EXIT_FAILURE);
}
timeout = atof(argv[ii+1]);
if (strcmp(argv[ii+1], "inf") == 0)
timeout = -1;
else
timeout = atof(argv[ii+1]);
++ii;
break;
case 'g':
......
......@@ -19,38 +19,48 @@ DESCRIPTION
If set to "human", stratego will request the user to make moves for the Red player using stdin.
NOTES
1. There is no plan to support AI programs named "human". Deal with it.
2. As of writing, human players must use stdin. A graphical interface may be added later.
2. The graphical interface for human players is... basic. Deal with it.
blue_player
As red_player, except for controlling the Blue player.
OPTIONS
-g
By default, graphics are disabled. If the -g switch is present, stratego will draw the game as it is played using OpenGL
By default, graphics are disabled. If the -g switch is present, stratego will draw the game as it is played using SDL/OpenGL
-p
By default, even if graphics are disabled, the board state is not printed. If -p is present, the board will be printed to stdout.
If the system supports colour, the characters will be in colour.
If -p and -g are both present you will see both behaviours (overkill)!
Yes, If -p and -g are both present you will see both behaviours (overkill)!
-i
By default, stratego will exit if a move which is deemed "illegal" is made. If the -i switch is present, illegal moves will be ignored.
That is, the move will not be made (effectively the player making the illegal move loses a turn).
NOTE: If -i is not given and a human player accidentally(?) makes an illegal move, they will be asked to make a different move. The game will continue.
This is intended to prevent fits of rage due to the horrible graphical interface causing humans to make illegal moves.
-r
By default, the identities of all pieces are shown. If the -r switch is present, and graphics are enabled, red pieces will be disguised.
If graphics are disabled, the -r switch has no effect.
Pieces which have previously taken part in combat (and survived) will be revealed.
-b
As -r, except blue pieces will be disguised.
NOTE: Both -r and -b may be used.
NOTE: Both -r and -b may be used together.
-o
By default, stratego is silent. If the -o switch is present, the result of each move is printed to a file. If output_file is "stdout"
then stdout will be used instead of a text file.
By default, stratego does not log moves. If the -o switch is present, the result of each move is printed to a file.
If output_file is "stdout" then stdout will be used instead of a text file.
-t
By default, stratego executes moves as fast as they are recieved. If the -t switch is present, a delay of stall_time will be introduced
between each move.
If stall_time is negative or "inf", stratego will wait for the user to press enter before moving to the next move.
It is tentatively planned to allow the user to enter various commands to alter the game or proceed to specified turns.
However this is slightly complicated. So it might never be done.
-m
By default, the game is declared a Draw after 5000 turns have ellapsed.
Use this option to change the maximum number of turns.
To play for an infinite number of turns, supply "inf" as max_number.
To play for an infinite number of turns, supply "inf" as max_number. This is not recommended for obvious reasons.
-f
By default, stratego requires red_player and blue_player to enact a game.
......@@ -107,6 +117,10 @@ PROTOCOL
RESPONSE: 4 lines, each of length BOARD_WIDTH, of characters. Each character represents a piece. The characters are shown above.
RED's pieces are placed at the top of the board, and BLUE's pieces are placed at the bottom.
An AI program does not have to place all 40 pieces, but must at least place the flag ('F').
2. TURN
QUERY: START | CONFIRMATION
BOARD_STATE
......@@ -127,23 +141,25 @@ PROTOCOL
The AI program should print "NO_MOVE" if it is unable to determine a move.
This will typically occur when the only pieces belonging to the AI program are Bombs and the Flag.
CONFIRMATION: X Y DIRECTION [MULTIPLIER=1] OUTCOME | NO_MOVE | QUIT RESULT
CONFIRMATION: X Y DIRECTION [MULTIPLIER=1] OUTCOME | NO_MOVE {OK | ILLEGAL} | QUIT [RESULT]
OUTCOME may be either OK, ILLEGAL, KILLS or DIES
OK - Move was successful
ILLEGAL - Move was not allowed. If stratego was not started with the -i switch, the game will end.
KILLS ATTACKER_RANK DEFENDER_RANK - The piece moved into an occupied square and killed the defender.
DIES ATTACKER_RANK DEFENDER_RANK - The piece moved into an occupied square and was killed by the defender.
A confirmation of "NO_MOVE" occurs when the AI program made no move for a legitimate reason.
Most turns will be confirmed with: "X Y DIRECTION [MULTIPLIER=1] OUTCOME"
A confirmation of "NO_MOVE OK" occurs when the AI program made no move for a legitimate reason.
"NO_MOVE ILLEGAL" is printed if the AI program made no move for an illegitimate reason.
If both AI programs successively make a "NO_MOVE" response, then the game will end.
The player with the highest piece value will win, or a draw will be declared if the values are equal.
3. END GAME
If the CONFIRMATION line is of the form:
QUIT RESULT
QUIT [RESULT]
Then the game is about to end.
If present, RESULT will be a direct copy of the message to stdout described in the EXIT/OUTPUT section below.
......@@ -190,7 +206,11 @@ EXIT/OUTPUT
BUGS
There are no known bugs at this time. However, stratego is still a work in progress. Report a bug to the AUTHOR (see below).
WARNING:
stratego has been observed to segfault occassionally after the end of a game. It is not yet known what is causing these errors.
They appear to occur most often when the result is a draw, however they have been observed to occur under all exit conditions except the Illegal case. The result is still printed to stdout. However this bug _must_ be fixed before stratego can be used by simulation scripts.
stratego is still a work in progress. Report another bug to the AUTHOR (see below).
AUTHORS
Sam Moore (for the UCC Programming Competition 2012) <[email protected]>
......
......@@ -202,7 +202,7 @@ void Board::PrintPretty(FILE * stream, const Piece::Colour & reveal)
* Draw the board state to graphics
* @param reveal - Pieces matching this colour will be revealed. All others will be shown as blank coloured squares.
*/
void Board::Draw(const Piece::Colour & reveal)
void Board::Draw(const Piece::Colour & reveal, bool showRevealed)
{
if (!Graphics::Initialised())
{
......@@ -223,7 +223,8 @@ void Board::Draw(const Piece::Colour & reveal)
//Don't display anything
}
else if (piece->colour != Piece::NONE && (piece->colour == reveal || reveal == Piece::BOTH))
else if ((piece->colour != Piece::NONE && (piece->colour == reveal || reveal == Piece::BOTH))
|| (piece->beenRevealed && showRevealed))
{
//Display the piece
Piece::textures[(int)(piece->type)].DrawColour(x*32,y*32,0,1, Piece::GetGraphicsColour(piece->colour));
......@@ -360,6 +361,9 @@ MovementResult Board::MovePiece(int x, int y, const Direction & direction, int m
}
else if (defender->colour != target->colour)
{
defender->beenRevealed = true;
target->beenRevealed = true;
Piece::Type defenderType = defender->type;
Piece::Type attackerType = target->type;
......
......@@ -108,7 +108,7 @@ class Board
void Print(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board
void PrintPretty(FILE * stream, const Piece::Colour & reveal=Piece::BOTH); //Print board using colour
void Draw(const Piece::Colour & reveal=Piece::BOTH); //Draw board
void Draw(const Piece::Colour & reveal=Piece::BOTH, bool showRevealed = true); //Draw board
bool AddPiece(int x, int y, const Piece::Type & newType, const Piece::Colour & newColour); //Add piece to board
......
......@@ -87,6 +87,8 @@ class BasicAI:
""" Implements Setup part of protocol. Always uses the same setup. Override to create custom setups """
#sys.stderr.write("BasicAI Setup here...\n");
setup = sys.stdin.readline().split(' ')
if len(setup) != 4:
sys.stderr.write("BasicAI setup fails, expected 4 tokens, got " + str(len(setup)) + " "+str(setup) + "\n")
self.colour = setup[0]
self.opponentName = setup[1]
self.width = int(setup[2])
......
......@@ -84,7 +84,7 @@ if len(agents) == 0:
if verbose:
print "Total: " + str(len(agents)) + " valid agents found (From "+str(len(agentNames))+" possibilities)"
print ""
print "Commencing ROUND " + str(roundNumber) + " combat! ("+str(nGames)+" games per pairing)"
print "Commencing ROUND " + str(roundNumber) + " combat! This could take a while... ("+str(nGames)+" games per pairing * " + str(len(agents) * len(agents)-1) + " pairings = " + str((len(agents) * len(agents)-1) * nGames) + " games)"
normalGames = 0
......
......@@ -6,157 +6,68 @@
<body>
<h1> Quick Details</h1>
<h2> git </h2>
<p> The git repository is listed on <a href="http://git.ucc.asn.au/"/>The UCC git page</a> as "progcomp2012.git" </p>
<p> <a href="http://git.ucc.asn.au/?p=progcomp2012.git;a=summary"/>Direct Link Here</a></p>
<h2> Mailing List </h2>
<p> We will use the same mailing list as last year (progcomp). </p>
<p> </p>
<p> There is a #progcomp irc channel on the ucc irc server where you can ask questions or help with setting things up. </p>
<h2> irc channel </h2>
<p> There is a #progcomp irc channel on the ucc irc server (irc.ucc.asn.au) where you can ask questions or help with setting things up. </p>
<h2> Programming Competition VM </h2>
<p> I am in the process of learning how to set up a VM for this competition. Please be patient. </p>
<h1> Stratego </h1>
<p> <a href="http://www.edcollins.com/stratego/"/>This site</a> explains what Stratego is. </p>
<p> I have never played this game. But it sounds cool. So naturally I decided to make a competition based on it. </p>
<p> My original idea was to force people to write AI for <a href="http://matches.ucc.asn.au/Astral"/>Astral</a>, but then I realised that that was a terrible idea. </p>
<p> There is in fact, already a <a href="http://www.strategousa.org/wiki/index.php/2010_Computer_Stratego_World_Championship"/>World Stratego Championship</a>. However, you have to use Metaforge. Using stdin/stdout will probably make it slightly easier for us. And its better to work out how to do these things ourselves. </p>
<p> Short Version: It is a board game in which all pieces have a value that is, initially, unknown to the opponent player. The objective is to destroy all enemy pieces, or capture the enemy "Flag". Pieces with higher values destroy pieces with lower values. There are several special pieces/rules. </p>
<h2> Programming Competition </h2>
<h1> Programming Competition </h1>
<p> Create an AI to play Stratego. </p>
<p> Yes, I <i> know </i> people are inherently lazy and won't be bothered to do this. But so far in setting this up I have learn quite a lot about inter-process communication, so thats good. </p>
<p> Programs are written independently and interface through stdin/stdout with a manager program, which queries them on setup and moves. </p>
<h3> The Manager Program </h3>
<p> The manager program takes two executable paths, one to each of the AI programs to pit against each other. <p>
<p> It first requests each program to print the setup of its pieces to stdout. Then the programs take turns (Red, then blue, etc) to move one piece. </p>
<p> The first program is Red (top of the board), the second is Blue (bottom of the board). </p>
<p> The manager program now has switches to enable/disable graphics and set the move speed of the match. </p>
<p> Use "-g" to enable graphics (by default disabled) and "-t TIMEOUT" to set the move speed (default 0 (as fast as possible)). </p>
<p> <b> This program now has a <a href="http://matches.ucc.asn.au/progcomp2012/manager/manual.txt"/>manual page</a> </b> </p>
<h2> Messaging Protocol and Rules </h2>
<p> <b> The rules are now also available in the <a href="http://matches.ucc.asn.au/progcomp2012/manager/manual.txt"/>manual page</a> of the manager program </b> </p>
<h3> Setup </h3>
<h4> Query </h4>
<p> The manager program prints one line in the following format to each program: </p>
<p> COLOUR OPPONENT BOARD_WIDTH BOARD_HEIGHT </p>
<p> At the moment BOARD_WIDTH and BOARD_HEIGHT are always 14. The arguments are followed by a newline. </p>
<p> OPPONENT will be the identity of the opposing AI program. </p>
<h4> Response </h4>
<p> The AI program queried must print <i>four</i> (4) lines containing its initial setup. Each character represents a unit or empty space. The characters are as follows: </p>
<p> The manager program provides the protocol for two seperate AI to play a game of stratego. It has the imaginative name of 'stratego', but I will probably refer to it as 'the manager program' or 'stratego' with absolutely no consistency. </p>
<p> It also aims to assist with AI design by providing options for graphical or terminal output and saving/reading games from files </p>
<p> </p>
<p><b>Warning:</b> I have changed the characters from mostly letters to mostly digits, indicating the actual worth of a piece</p>
<table border="1">
<tr> <th>Name</th> <th>Character</th> <th> Number </th> <th> Notes </th> </tr>
<tr> <td>Marshal</td> <td>1</td> <td>1</td> <td> Dies if attacked by the Spy </td> </tr>
<tr> <td>General</td> <td>2</td> <td>1</td> <td> </td> </tr>
<tr> <td>Colonel</td> <td>3</td> <td>2</td> <td> </td> </tr>
<tr> <td>Major</td> <td>4</td> <td>3</td> <td> </td> </tr>
<tr> <td>Captain</td> <td>5</td> <td>4</td> <td> </td> </tr>
<tr> <td>Lietenant</td> <td>6</td> <td>4</td> <td> </td> </tr>
<tr> <td>Sergeant</td> <td>7</td> <td>4</td> <td> </td> </tr>
<tr> <td>Miner</td> <td>8</td> <td>5</td> <td> Defuses Bombs and survives. </td> </tr>