Fix inadvertent "TQ" changes.

pull/1/head
Darrell Anderson 13 years ago
parent 7837f2ddb8
commit 1f0b774c59

@ -582,7 +582,7 @@ struct freecell_solver_soft_thread_struct
/* /*
* The priority queue of the A* scan */ * The priority queue of the A* scan */
PTQUEUE * a_star_pqueue; PQUEUE * a_star_pqueue;
double a_star_initial_cards_under_sequences; double a_star_initial_cards_under_sequences;
/* /*

@ -214,7 +214,7 @@ static freecell_solver_soft_thread_t * alloc_soft_thread(
freecell_solver_initialize_bfs_queue(soft_thread); freecell_solver_initialize_bfs_queue(soft_thread);
/* Initialize the priotity queue of the A* scan */ /* Initialize the priotity queue of the A* scan */
soft_thread->a_star_pqueue = malloc(sizeof(PTQUEUE)); soft_thread->a_star_pqueue = malloc(sizeof(PQUEUE));
freecell_solver_PQueueInitialise( freecell_solver_PQueueInitialise(
soft_thread->a_star_pqueue, soft_thread->a_star_pqueue,
1024 1024

@ -658,12 +658,12 @@ int main(int argc, char * argv[])
if ((arg == argc) || (!strcmp(argv[arg], "-"))) if ((arg == argc) || (!strcmp(argv[arg], "-")))
{ {
file = stdin; file = stdin;
if (!getenv("FREECELL_SOLVER_TQUIET")) if (!getenv("FREECELL_SOLVER_QUIET"))
{ {
fprintf(stderr, "%s", fprintf(stderr, "%s",
"Reading the board from the standard input.\n" "Reading the board from the standard input.\n"
"Type \"fc-solve --help\" for more usage information.\n" "Type \"fc-solve --help\" for more usage information.\n"
"To cancel this message set the FREECELL_SOLVER_TQUIET environment variable.\n" "To cancel this message set the FREECELL_SOLVER_QUIET environment variable.\n"
); );
} }
} }

@ -33,7 +33,7 @@
the list is sorted ascending or descending... */ the list is sorted ascending or descending... */
void freecell_solver_PQueueInitialise( void freecell_solver_PQueueInitialise(
PTQUEUE *pq, PQUEUE *pq,
int32 MaxElements int32 MaxElements
) )
{ {
@ -53,7 +53,7 @@ void freecell_solver_PQueueInitialise(
returns TRUE if successful, FALSE if fails. (You fail by filling the pqueue.) returns TRUE if successful, FALSE if fails. (You fail by filling the pqueue.)
PGetRating is a function which returns the rating of the item you're adding for sorting purposes */ PGetRating is a function which returns the rating of the item you're adding for sorting purposes */
int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t r) int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t r)
{ {
uint32 i; uint32 i;
pq_element_t * Elements = pq->Elements; pq_element_t * Elements = pq->Elements;
@ -83,7 +83,7 @@ int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t r)
{ {
while( ( i==PTQ_FIRST_ENTRY ? while( ( i==PTQ_FIRST_ENTRY ?
(PTQUEUE_MaxRating) /* return biggest possible rating if first element */ (PQUEUE_MaxRating) /* return biggest possible rating if first element */
: :
(PGetRating(Elements[ PTQ_PARENT_INDEX(i) ]) ) (PGetRating(Elements[ PTQ_PARENT_INDEX(i) ]) )
) )
@ -110,14 +110,14 @@ int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t r)
#define PQueueIsEmpty(pq) ((pq)->CurrentSize == 0) #define PQueueIsEmpty(pq) ((pq)->CurrentSize == 0)
/* free up memory for pqueue */ /* free up memory for pqueue */
void freecell_solver_PQueueFree( PTQUEUE *pq ) void freecell_solver_PQueueFree( PQUEUE *pq )
{ {
free( pq->Elements ); free( pq->Elements );
} }
/* remove the first node from the pqueue and provide a pointer to it */ /* remove the first node from the pqueue and provide a pointer to it */
void *freecell_solver_PQueuePop( PTQUEUE *pq) void *freecell_solver_PQueuePop( PQUEUE *pq)
{ {
int32 i; int32 i;
int32 child; int32 child;

@ -11,8 +11,8 @@
http://www.geocities.com/jheyesjones/astar.html http://www.geocities.com/jheyesjones/astar.html
*/ */
#ifndef FC_SOLVE__PTQUEUE_H #ifndef FC_SOLVE__PQUEUE_H
#define FC_SOLVE__PTQUEUE_H #define FC_SOLVE__PQUEUE_H
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -22,7 +22,7 @@ extern "C" {
#include "jhjtypes.h" #include "jhjtypes.h"
#define PTQUEUE_MaxRating INT_MAX #define PQUEUE_MaxRating INT_MAX
typedef int32 pq_rating_t; typedef int32 pq_rating_t;
@ -32,13 +32,13 @@ typedef struct struct_pq_element_t
pq_rating_t rating; pq_rating_t rating;
} pq_element_t; } pq_element_t;
typedef struct _PTQUEUE typedef struct _PQUEUE
{ {
int32 MaxSize; int32 MaxSize;
int32 CurrentSize; int32 CurrentSize;
pq_element_t * Elements; /* pointer to void pointers */ pq_element_t * Elements; /* pointer to void pointers */
pq_rating_t MaxRating; /* biggest element possible */ pq_rating_t MaxRating; /* biggest element possible */
} PTQUEUE; } PQUEUE;
/* given an index to any element in a binary tree stored in a linear array with the root at 1 and /* given an index to any element in a binary tree stored in a linear array with the root at 1 and
a "sentinel" value at 0 these macros are useful in making the code clearer */ a "sentinel" value at 0 these macros are useful in making the code clearer */
@ -52,15 +52,15 @@ typedef struct _PTQUEUE
#define PTQ_RIGHT_CHILD_INDEX(i) (((i)<<1)+1) #define PTQ_RIGHT_CHILD_INDEX(i) (((i)<<1)+1)
void freecell_solver_PQueueInitialise( void freecell_solver_PQueueInitialise(
PTQUEUE *pq, PQUEUE *pq,
int32 MaxElements int32 MaxElements
); );
void freecell_solver_PQueueFree( PTQUEUE *pq ); void freecell_solver_PQueueFree( PQUEUE *pq );
int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t); int freecell_solver_PQueuePush( PQUEUE *pq, void *item, pq_rating_t);
void *freecell_solver_PQueuePop( PTQUEUE *pq); void *freecell_solver_PQueuePop( PQUEUE *pq);
#define PGetRating(elem) ((elem).rating) #define PGetRating(elem) ((elem).rating)
@ -68,4 +68,4 @@ void *freecell_solver_PQueuePop( PTQUEUE *pq);
} }
#endif #endif
#endif /* #ifdef FC_SOLVE__PTQUEUE_H */ #endif /* #ifdef FC_SOLVE__PQUEUE_H */

@ -945,7 +945,7 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume(
); );
int scans_synergy = instance->scans_synergy; int scans_synergy = instance->scans_synergy;
fcs_states_linked_list_item_t * bfs_queue = soft_thread->bfs_queue; fcs_states_linked_list_item_t * bfs_queue = soft_thread->bfs_queue;
PTQUEUE * a_star_pqueue = soft_thread->a_star_pqueue; PQUEUE * a_star_pqueue = soft_thread->a_star_pqueue;
fcs_states_linked_list_item_t * bfs_queue_last_item = soft_thread->bfs_queue_last_item; fcs_states_linked_list_item_t * bfs_queue_last_item = soft_thread->bfs_queue_last_item;
derived.num_states = 0; derived.num_states = 0;

@ -43,7 +43,7 @@ typedef enum {
C_NINE, D_NINE, S_NINE, H_NINE, C_NINE, D_NINE, S_NINE, H_NINE,
C_TEN, D_TEN, S_TEN, H_TEN, C_TEN, D_TEN, S_TEN, H_TEN,
C_JACK, D_JACK, S_JACK, H_JACK, C_JACK, D_JACK, S_JACK, H_JACK,
C_TQUEEN, D_TQUEEN, S_TQUEEN, H_TQUEEN, C_QUEEN, D_QUEEN, S_QUEEN, H_QUEEN,
C_KING, D_KING, S_KING, H_KING, C_KING, D_KING, S_KING, H_KING,
C_ACE, D_ACE, S_ACE, H_ACE, C_ACE, D_ACE, S_ACE, H_ACE,
ROOF // to get a roof on the value. ROOF // to get a roof on the value.
@ -73,7 +73,7 @@ typedef enum {
NINE, NINE,
TEN, TEN,
JACK, JACK,
TQUEEN, QUEEN,
KING, KING,
ACE // The most valuable rank ACE // The most valuable rank
} CardRank; } CardRank;

@ -17,8 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef TQUEUE_H #ifndef QUEUE_H
#define TQUEUE_H #define QUEUE_H
#include <assert.h> #include <assert.h>
@ -53,4 +53,4 @@ public:
} }
}; };
#endif /* TQUEUE_H */ #endif /* QUEUE_H */

@ -117,7 +117,7 @@ public:
/** /**
* Constructs a KGamePropertyBase object and calls registerData. * Constructs a KGamePropertyBase object and calls registerData.
* @param id The id of this property. MUST be UNITQUE! Used to send and * @param id The id of this property. MUST be UNIQUE! Used to send and
* receive changes in the property of the playere automatically via * receive changes in the property of the playere automatically via
* network. * network.
* @param owner The owner of the object. Must be a KGamePropertyHandler which manages * @param owner The owner of the object. Must be a KGamePropertyHandler which manages
@ -585,7 +585,7 @@ public:
* Constructs a KGameProperty object. A KGameProperty object will transmit * Constructs a KGameProperty object. A KGameProperty object will transmit
* any changes to the KMessageServer and then to all clients in the * any changes to the KMessageServer and then to all clients in the
* game (including the one that has sent the new value) * game (including the one that has sent the new value)
* @param id The id of this property. <em>MUST be UNITQUE</em>! Used to send and * @param id The id of this property. <em>MUST be UNIQUE</em>! Used to send and
* receive changes in the property of the playere automatically via * receive changes in the property of the playere automatically via
* network. * network.
* @param owner The parent of the object. Must be a KGame which manages * @param owner The parent of the object. Must be a KGame which manages

@ -1,6 +1,6 @@
<HTML> <HTML>
<HEAD> <HEAD>
<META HTTP-ETQUIV="Content-Type" CONTENT="text/html";> <META HTTP-EQUIV="Content-Type" CONTENT="text/html";>
<TITLE>Four wins manual</TITLE> <TITLE>Four wins manual</TITLE>
</HEAD> </HEAD>

Loading…
Cancel
Save