8a63c78087
Amazons is a game played on a 10x10 chess board. Each side has four pieces (amazons) that move like chess queens (in a straight line in any direction). Instead of capturing pieces like in chess, the game is determined based on who moves last. Each move consists of two parts. First an amazon moves to a new square and then fires an arrow to another square (the arrow is fired in a straight line in any direction from the square the amazon landed on). The square the arrow lands on becomes a permenant block for the rest of the game. No one can move over it, or fire an arrow over it. Every turn an amazon must move and fire an arrow, so every turn there is one less square available on the board. Try and block in your opponent or section off a good chunk of the board for yourself.
32 lines
947 B
Text
32 lines
947 B
Text
$NetBSD: patch-aa,v 1.1.1.1 2007/01/06 02:07:50 wiz Exp $
|
|
|
|
--- src/board.c.orig 2002-11-25 00:47:38.000000000 +0000
|
|
+++ src/board.c
|
|
@@ -1403,8 +1403,7 @@ int get_move_from_str(move *m, char move
|
|
|
|
int read_in_moves(FILE *history_fd)
|
|
{
|
|
- char *buffer=NULL;
|
|
- size_t buf_size = 30;
|
|
+ char buffer[1024];
|
|
|
|
state *s;
|
|
move m;
|
|
@@ -1422,7 +1421,7 @@ int read_in_moves(FILE *history_fd)
|
|
bstate_set_dont_slide(TRUE);
|
|
}
|
|
//printf("History contents:\n");
|
|
- while (getline(&buffer, &buf_size, history_fd) != -1)
|
|
+ while (fgets(buffer, sizeof(buffer), history_fd) != NULL)
|
|
{
|
|
if (replay_mode && !bstate_get_replay_mode()) //If not in replay mode anymore, drop out
|
|
return FALSE;
|
|
@@ -1446,8 +1445,6 @@ int read_in_moves(FILE *history_fd)
|
|
bstate_set_dont_slide(FALSE);
|
|
return FALSE;
|
|
}
|
|
- free(buffer);
|
|
- buffer = NULL;
|
|
|
|
if (replay_mode) //Delay for appropriate amount of time
|
|
{
|