diff options
Diffstat (limited to 'kpat/freecell-solver')
-rw-r--r-- | kpat/freecell-solver/USAGE | 28 | ||||
-rw-r--r-- | kpat/freecell-solver/caas.c | 12 | ||||
-rw-r--r-- | kpat/freecell-solver/fcs.h | 2 | ||||
-rw-r--r-- | kpat/freecell-solver/fcs_hash.c | 12 | ||||
-rw-r--r-- | kpat/freecell-solver/fcs_hash.h | 4 | ||||
-rw-r--r-- | kpat/freecell-solver/freecell.c | 12 | ||||
-rw-r--r-- | kpat/freecell-solver/intrface.c | 8 | ||||
-rw-r--r-- | kpat/freecell-solver/lookup2.c | 2 | ||||
-rw-r--r-- | kpat/freecell-solver/main.c | 32 | ||||
-rw-r--r-- | kpat/freecell-solver/pqueue.c | 2 | ||||
-rw-r--r-- | kpat/freecell-solver/pqueue.h | 2 | ||||
-rw-r--r-- | kpat/freecell-solver/scans.c | 10 | ||||
-rw-r--r-- | kpat/freecell-solver/simpsim.c | 48 | ||||
-rw-r--r-- | kpat/freecell-solver/state.h | 6 | ||||
-rw-r--r-- | kpat/freecell-solver/test_arr.h | 22 | ||||
-rw-r--r-- | kpat/freecell-solver/tests.h | 12 |
16 files changed, 107 insertions, 107 deletions
diff --git a/kpat/freecell-solver/USAGE b/kpat/freecell-solver/USAGE index 9cffe4e1..16f5c93d 100644 --- a/kpat/freecell-solver/USAGE +++ b/kpat/freecell-solver/USAGE @@ -67,7 +67,7 @@ program with some effort on the programmer's part. This option will display the moves in standard notation in which every move consists of two characters and there are ten moves in a line. Naturally, -this option will only become aptqparent if the display moves is specified. +this option will only become apparent if the display moves is specified. (it does not implicitly specify it, though). For more information regarding standard notation refer to the following @@ -89,7 +89,7 @@ are needed to move from one to another. The standard notation option applies to it to. --pi --display-tqparent-iter +-pi --display-parent-iter This option (assuming the -s and -i options are specified) will also display the iteration index of the state from which the current state @@ -217,34 +217,34 @@ Freecell Tests: '2' - put freecell cards on top of stacks. '3' - put non-top stack cards in the foundations. '4' - move stack cards to different stacks. -'5' - move stack cards to a tqparent card on the same stack. +'5' - move stack cards to a parent card on the same stack. '6' - move sequences of cards onto free stacks. '7' - put freecell cards on empty stacks. -'8' - move cards to a different tqparent. +'8' - move cards to a different parent. '9' - empty an entire stack into the freecells. Atomic Freecell Tests: 'A' - move a stack card to an empty stack. -'B' - move a stack card to a tqparent on a different stack. +'B' - move a stack card to a parent on a different stack. 'C' - move a stack card to a freecell. -'D' - move a freecell card to a tqparent. +'D' - move a freecell card to a parent. 'E' - move a freecell card to an empty stack. Simple Simon Tests: 'a' - move a full sequence to the foundations. -'b' - move a sequence to a true tqparent of his. -'c' - move a whole stack sequence to a false tqparent (in order to clear +'b' - move a sequence to a true parent of his. +'c' - move a whole stack sequence to a false parent (in order to clear the stack) -'d' - move a sequence to a true tqparent that has some cards above it. -'e' - move a sequence with some cards above it to a true tqparent. -'f' - move a sequence with a junk sequence above it to a true tqparent that +'d' - move a sequence to a true parent that has some cards above it. +'e' - move a sequence with some cards above it to a true parent. +'f' - move a sequence with a junk sequence above it to a true parent that has some cards above it. -'g' - move a whole stack sequence to a false tqparent which has some +'g' - move a whole stack sequence to a false parent which has some cards above it. -'h' - move a sequence to a tqparent on the same stack. +'h' - move a sequence to a parent on the same stack. Manipulating the tests order can be very helpful to the quick solution of a given board. If you found that a certain board cannot be solved in @@ -332,7 +332,7 @@ used in all the normal scans. --reparent-states This option specifies that states that were encountered whose depth in the -states graph can be improved should be reparented to the new tqparent. This +states graph can be improved should be reparented to the new parent. This option can possibly make solutions shorter. diff --git a/kpat/freecell-solver/caas.c b/kpat/freecell-solver/caas.c index 4d359a40..8e8f5ebb 100644 --- a/kpat/freecell-solver/caas.c +++ b/kpat/freecell-solver/caas.c @@ -63,7 +63,7 @@ if (hash_value_int < 0) \ { \ /* \ - * This is a bit tqmask that nullifies the sign bit of the \ + * This is a bit mask that nullifies the sign bit of the \ * number so it will always be positive \ * */ \ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); \ @@ -92,7 +92,7 @@ if (hash_value_int < 0) \ { \ /* \ - * This is a bit tqmask that nullifies the sign bit of the \ + * This is a bit mask that nullifies the sign bit of the \ * number so it will always be positive \ * */ \ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); \ @@ -333,7 +333,7 @@ static GCC_INLINE void freecell_solver_cache_stacks( if (hash_value_int < 0) { /* - * This is a bit tqmask that nullifies the sign bit of the + * This is a bit mask that nullifies the sign bit of the * number so it will always be positive * */ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); @@ -437,7 +437,7 @@ void freecell_solver_cache_talon( if (hash_value_int < 0) { /* - * This is a bit tqmask that nullifies the sign bit of the + * This is a bit mask that nullifies the sign bit of the * number so it will always be positive * */ hash_value_int &= (~(1<<((sizeof(hash_value_int)<<3)-1))); @@ -529,9 +529,9 @@ GCC_INLINE int freecell_solver_check_and_add_state( if (check) { /* The new state was not found in the cache, and it was already inserted */ - if (new_state->tqparent) + if (new_state->parent) { - new_state->tqparent->num_active_tqchildren++; + new_state->parent->num_active_tqchildren++; } instance->num_states_in_collection++; diff --git a/kpat/freecell-solver/fcs.h b/kpat/freecell-solver/fcs.h index b865a3f0..63db42a6 100644 --- a/kpat/freecell-solver/fcs.h +++ b/kpat/freecell-solver/fcs.h @@ -170,7 +170,7 @@ typedef struct freecell_solver_instance * The debug_iter_output variables provide a programmer programmable way * to debug the algorithm while it is running. This works well for DFS * and Soft-DFS scans but at present support for A* and BFS is not - * too good, as its hard to tell which state came from which tqparent state. + * too good, as its hard to tell which state came from which parent state. * * debug_iter_output is a flag that indicates whether to use this feature * at all. diff --git a/kpat/freecell-solver/fcs_hash.c b/kpat/freecell-solver/fcs_hash.c index 2ae2d60b..fde7a03f 100644 --- a/kpat/freecell-solver/fcs_hash.c +++ b/kpat/freecell-solver/fcs_hash.c @@ -53,7 +53,7 @@ SFO_hash_t * freecell_solver_hash_init( hash = (SFO_hash_t *)malloc(sizeof(SFO_hash_t)); hash->size = size; - hash->size_bittqmask = size-1; + hash->size_bitmask = size-1; hash->num_elems = 0; @@ -87,7 +87,7 @@ void * freecell_solver_hash_insert( SFO_hash_symlink_item_t * item, * last_item; /* Get the index of the appropriate chain in the hash table */ - place = hash_value & (hash->size_bittqmask); + place = hash_value & (hash->size_bitmask); list = &(hash->entries[place]); /* If first_item is non-existent */ @@ -220,7 +220,7 @@ static void SFO_hash_rehash( SFO_hash_t * hash ) { - int old_size, new_size, new_size_bittqmask; + int old_size, new_size, new_size_bitmask; int i; #if 0 SFO_hash_t * new_hash; @@ -242,7 +242,7 @@ static void SFO_hash_rehash( old_size = hash->size; new_size = old_size << 1; - new_size_bittqmask = new_size - 1; + new_size_bitmask = new_size - 1; new_entries = calloc(new_size, sizeof(SFO_hash_symlink_t)); @@ -254,7 +254,7 @@ static void SFO_hash_rehash( while(item != NULL) { /* The place in the new hash table */ - place = item->hash_value & new_size_bittqmask; + place = item->hash_value & new_size_bitmask; /* Store the next item in the linked list in a safe place, so we can retrieve it after the assignment */ @@ -280,7 +280,7 @@ static void SFO_hash_rehash( #endif hash->entries = new_entries; hash->size = new_size; - hash->size_bittqmask = new_size_bittqmask; + hash->size_bitmask = new_size_bitmask; } #else diff --git a/kpat/freecell-solver/fcs_hash.h b/kpat/freecell-solver/fcs_hash.h index 77d746f0..fbe6c78c 100644 --- a/kpat/freecell-solver/fcs_hash.h +++ b/kpat/freecell-solver/fcs_hash.h @@ -53,8 +53,8 @@ struct SFO_hash_struct /* The size of the hash table */ int size; - /* A bit tqmask that extract the lowest bits out of the hash value */ - int size_bittqmask; + /* A bit mask that extract the lowest bits out of the hash value */ + int size_bitmask; /* The number of elements stored inside the hash */ int num_elems; /* A context to pass to the comparison function */ diff --git a/kpat/freecell-solver/freecell.c b/kpat/freecell-solver/freecell.c index fca09078..159772ff 100644 --- a/kpat/freecell-solver/freecell.c +++ b/kpat/freecell-solver/freecell.c @@ -243,7 +243,7 @@ int freecell_solver_sfs_move_freecell_cards_on_top_of_stacks( { src_card = fcs_freecell_card(state, fc); - /* If the freecell is not empty and dest_card is its tqparent + /* If the freecell is not empty and dest_card is its parent * */ if ( (fcs_card_card_num(src_card) != 0) && fcs_is_parent_card(src_card,dest_card) ) @@ -533,7 +533,7 @@ int freecell_solver_sfs_move_stack_cards_to_a_parent_on_the_same_stack( sequences_are_built_by = instance->sequences_are_built_by; /* - * Now let's try to move a stack card to a tqparent card which is found + * Now let's try to move a stack card to a parent card which is found * on the same stack. * */ for (stack=0;stack<state_stacks_num;stack++) @@ -547,7 +547,7 @@ int freecell_solver_sfs_move_stack_cards_to_a_parent_on_the_same_stack( card = fcs_stack_card(state, stack, c); - /* Do not move cards that are already found above a suitable tqparent */ + /* Do not move cards that are already found above a suitable parent */ a = 1; if (c != 0) { @@ -1368,7 +1368,7 @@ int freecell_solver_sfs_move_cards_to_a_different_parent( fcs_move_init(temp_move); - /* This time try to move cards that are already on top of a tqparent to a different tqparent */ + /* This time try to move cards that are already on top of a parent to a different parent */ for (stack=0;stack<state_stacks_num;stack++) { @@ -1398,7 +1398,7 @@ int freecell_solver_sfs_move_cards_to_a_different_parent( card = fcs_stack_card(state, stack, c); - /* Do not move cards that are already found above a suitable tqparent */ + /* Do not move cards that are already found above a suitable parent */ a = 1; if (c != 0) { @@ -1697,7 +1697,7 @@ int freecell_solver_sfs_yukon_move_card_to_parent( if (fcs_is_parent_card(card, dest_card)) { /* We can move it there - now let's check to see - * if it is already above a suitable tqparent. */ + * if it is already above a suitable parent. */ if ((c == 0) || (! fcs_is_parent_card(card, fcs_stack_card(state, stack, c-1)))) { diff --git a/kpat/freecell-solver/intrface.c b/kpat/freecell-solver/intrface.c index 44aa29a0..9fb09840 100644 --- a/kpat/freecell-solver/intrface.c +++ b/kpat/freecell-solver/intrface.c @@ -796,7 +796,7 @@ static void trace_solution( s1 = instance->final_state; /* Retrace the step from the current state to its parents */ - while (s1->tqparent != NULL) + while (s1->parent != NULL) { /* Mark the state as part of the non-optimized solution */ s1->visited |= FCS_VISITED_IN_SOLUTION_PATH; @@ -811,8 +811,8 @@ static void trace_solution( } /* Duplicate the state to a freshly malloced memory */ - /* Move to the tqparent state */ - s1 = s1->tqparent; + /* Move to the parent state */ + s1 = s1->parent; } /* There's one more state than there are move stacks */ s1->visited |= FCS_VISITED_IN_SOLUTION_PATH; @@ -915,7 +915,7 @@ int freecell_solver_solve_instance( state_copy_ptr->depth = 0; state_copy_ptr->moves_to_parent = NULL; state_copy_ptr->visited = 0; - state_copy_ptr->tqparent = NULL; + state_copy_ptr->parent = NULL; memset(&(state_copy_ptr->scan_visited), '\0', sizeof(state_copy_ptr->scan_visited)); instance->state_copy_ptr = state_copy_ptr; diff --git a/kpat/freecell-solver/lookup2.c b/kpat/freecell-solver/lookup2.c index c5886304..6ab9ae7e 100644 --- a/kpat/freecell-solver/lookup2.c +++ b/kpat/freecell-solver/lookup2.c @@ -19,7 +19,7 @@ Note: #define hashsize(n) ((ub4)1<<(n)) -#define hashtqmask(n) (hashsize(n)-1) +#define hashmask(n) (hashsize(n)-1) /* -------------------------------------------------------------------- diff --git a/kpat/freecell-solver/main.c b/kpat/freecell-solver/main.c index 181039b6..4a47f300 100644 --- a/kpat/freecell-solver/main.c +++ b/kpat/freecell-solver/main.c @@ -169,8 +169,8 @@ help_screen_t help_screens[] = { "-snx --standard-notation-extended\n" " Display the moves in extended standard notation while specifying the\n" " number of cards moved if applicable\n" -"-pi --display-tqparent-iter \n" -" Display the index of the tqparent iteration of each state in the\n" +"-pi --display-parent-iter \n" +" Display the index of the parent iteration of each state in the\n" " run-time dump.\n" "\n" "--freecells-num [Freecells\' Number]\n" @@ -227,33 +227,33 @@ help_screen_t help_screens[] = { " '2' - put freecell cards on top of stacks.\n" " '3' - put non-top stack cards in the foundations.\n" " '4' - move stack cards to different stacks.\n" -" '5' - move stack cards to a tqparent card on the same stack.\n" +" '5' - move stack cards to a parent card on the same stack.\n" " '6' - move sequences of cards onto free stacks.\n" " '7' - put freecell cards on empty stacks.\n" -" '8' - move cards to a different tqparent.\n" +" '8' - move cards to a different parent.\n" " '9' - empty an entire stack into the freecells.\n" "\n" " Atomic Freecell Tests:\n" "\n" " 'A' - move a stack card to an empty stack.\n" -" 'B' - move a stack card to a tqparent on a different stack.\n" +" 'B' - move a stack card to a parent on a different stack.\n" " 'C' - move a stack card to a freecell.\n" -" 'D' - move a freecel card to a tqparent.\n" +" 'D' - move a freecel card to a parent.\n" " 'E' - move a freecel card to an empty stack.\n" "\n" " Simple Simon Tests:\n" "\n" " 'a' - move a full sequence to the foundations.\n" -" 'b' - move a sequence to a true tqparent of his.\n" -" 'c' - move a whole stack sequence to a false tqparent (in order to\n" +" 'b' - move a sequence to a true parent of his.\n" +" 'c' - move a whole stack sequence to a false parent (in order to\n" " clear the stack)\n" -" 'd' - move a sequence to a true tqparent that has some cards above it.\n" -" 'e' - move a sequence with some cards above it to a true tqparent.\n" -" 'f' - move a sequence with a junk sequence above it to a true tqparent\n" +" 'd' - move a sequence to a true parent that has some cards above it.\n" +" 'e' - move a sequence with some cards above it to a true parent.\n" +" 'f' - move a sequence with a junk sequence above it to a true parent\n" " that has some cards above it.\n" -" 'g' - move a whole stack sequence to a false tqparent which has some\n" +" 'g' - move a whole stack sequence to a false parent which has some\n" " cards above it.\n" -" 'h' - move a sequence to a tqparent on the same stack.\n" +" 'h' - move a sequence to a parent on the same stack.\n" "\n" " Tests are grouped with parenthesis or square brackets. Each group\n" " will be randomized as a whole by the random-dfs scan.\n" @@ -313,7 +313,7 @@ help_screen_t help_screens[] = { "\n" "\n" "--reparent-states\n" -" Retqparent states that have a larger depth than that of the state\n" +" Reparent states that have a larger depth than that of the state\n" " from which they were reached a posteriori.\n" "--calc-real-depth\n" " If --reparent-states is enabled, then explictly calculate the real\n" @@ -498,7 +498,7 @@ static int cmd_line_callback( dc->display_moves = 1; dc->display_states = 1; } - else if ((!strcmp(argv[arg], "-pi")) || (!strcmp(argv[arg], "--display-tqparent-iter"))) + else if ((!strcmp(argv[arg], "-pi")) || (!strcmp(argv[arg], "--display-parent-iter"))) { dc->display_parent_iter_num = 1; } @@ -588,7 +588,7 @@ static char * known_parameters[] = { "-sn", "--standard-notation", "-snx", "--standard-notation-extended", "-sam", "--display-states-and-moves", - "-pi", "--display-tqparent-iter", + "-pi", "--display-parent-iter", "--reset", NULL }; diff --git a/kpat/freecell-solver/pqueue.c b/kpat/freecell-solver/pqueue.c index 7cacf8ff..90afc168 100644 --- a/kpat/freecell-solver/pqueue.c +++ b/kpat/freecell-solver/pqueue.c @@ -73,7 +73,7 @@ int freecell_solver_PQueuePush( PTQUEUE *pq, void *item, pq_rating_t r) i = (++CurrentSize); - /* while the tqparent of the space we're putting the new node into is worse than + /* while the parent of the space we're putting the new node into is worse than our new node, swap the space with the worse node. We keep doing that until we get to a worse node or until we get to the top diff --git a/kpat/freecell-solver/pqueue.h b/kpat/freecell-solver/pqueue.h index d4cfd7a3..875741ae 100644 --- a/kpat/freecell-solver/pqueue.h +++ b/kpat/freecell-solver/pqueue.h @@ -43,7 +43,7 @@ typedef struct _PTQUEUE /* 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 */ -/* the tqparent is always given by index/2 */ +/* the parent is always given by index/2 */ #define PTQ_PARENT_INDEX(i) ((i)>>1) #define PTQ_FIRST_ENTRY (1) diff --git a/kpat/freecell-solver/scans.c b/kpat/freecell-solver/scans.c index 31a5dd18..a4368873 100644 --- a/kpat/freecell-solver/scans.c +++ b/kpat/freecell-solver/scans.c @@ -406,7 +406,7 @@ int freecell_solver_soft_dfs_or_random_dfs_do_solve_or_resume( freecell_solver_increase_dfs_max_depth(soft_thread); /* Initialize the initial state to indicate it is the first */ - ptr_state_with_locations_orig->tqparent = NULL; + ptr_state_with_locations_orig->parent = NULL; ptr_state_with_locations_orig->moves_to_parent = NULL; ptr_state_with_locations_orig->depth = 0; @@ -692,7 +692,7 @@ int freecell_solver_soft_dfs_or_random_dfs_do_solve_or_resume( ptr_recurse_into_state_with_locations->visited_iter = instance->num_times; #if 0 - ptr_recurse_into_state_with_locations->tqparent = ptr_state_with_locations; + ptr_recurse_into_state_with_locations->parent = ptr_state_with_locations; #endif /* @@ -958,7 +958,7 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume( if (!resume) { /* Initialize the first element to indicate it is the first */ - ptr_state_with_locations_orig->tqparent = NULL; + ptr_state_with_locations_orig->parent = NULL; ptr_state_with_locations_orig->moves_to_parent = NULL; ptr_state_with_locations_orig->depth = 0; } @@ -1027,9 +1027,9 @@ int freecell_solver_a_star_or_bfs_do_solve_or_resume( ptr_state_with_locations->depth, (void*)instance, ptr_state_with_locations, - ((ptr_state_with_locations->tqparent == NULL) ? + ((ptr_state_with_locations->parent == NULL) ? 0 : - ptr_state_with_locations->tqparent->visited_iter + ptr_state_with_locations->parent->visited_iter ) ); } diff --git a/kpat/freecell-solver/simpsim.c b/kpat/freecell-solver/simpsim.c index 5ef8a411..f603ba39 100644 --- a/kpat/freecell-solver/simpsim.c +++ b/kpat/freecell-solver/simpsim.c @@ -19,16 +19,16 @@ #endif -#define fcs_is_ss_false_parent(tqparent, child) \ - (fcs_card_card_num(tqparent) == fcs_card_card_num(child)+1) +#define fcs_is_ss_false_parent(parent, child) \ + (fcs_card_card_num(parent) == fcs_card_card_num(child)+1) #define fcs_suit_is_ss_true_parent(parent_suit, child_suit) \ ((parent_suit) == (child_suit)) -#define fcs_is_ss_true_parent(tqparent, child) \ +#define fcs_is_ss_true_parent(parent, child) \ ( \ - fcs_is_ss_false_parent(tqparent,child) && \ - (fcs_suit_is_ss_true_parent(fcs_card_suit(tqparent),fcs_card_suit(child))) \ + fcs_is_ss_false_parent(parent,child) && \ + (fcs_suit_is_ss_true_parent(fcs_card_suit(parent),fcs_card_suit(child))) \ ) /* @@ -185,7 +185,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent( if (cards_num > 0) { /* Loop on the cards in the stack and try to look for a true - * tqparent on top one of the stacks */ + * parent on top one of the stacks */ card = fcs_stack_card(state,stack,cards_num-1); card_num = fcs_card_card_num(card); suit = fcs_card_suit(card); @@ -208,7 +208,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent( (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable tqparent - let's check if we + /* This is a suitable parent - let's check if we * have enough empty stacks to make the move feasible */ if (calc_max_sequence_move(0, num_freestacks) >= num_true_seqs) { @@ -334,7 +334,7 @@ int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent( (fcs_is_ss_false_parent(dest_card, card)) ) { - /* This is a suitable tqparent - let's check if we + /* This is a suitable parent - let's check if we * have enough empty stacks to make the move feasible */ if (calc_max_sequence_move(0, num_freestacks) >= num_true_seqs) { @@ -387,7 +387,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card * dest_cards_num - the number of cards in "ds" * dc - the index of the current card in "ds". * num_separate_false_seqs - this variable tells how many distinct false - * sequences exist above the true tqparent + * sequences exist above the true parent * above_num_true_seqs[] - the number of true sequences in each false * sequence * seq_points[] - the separation points of the false sequences (i.e: where @@ -451,7 +451,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable tqparent - let's check if there's a sequence above it. */ + /* This is a suitable parent - let's check if there's a sequence above it. */ /* * above_c - the height of the card that is to be checked. @@ -504,7 +504,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card int clear_junk_dest_stack = -1; - /* Let's try to find a suitable tqparent on top one of the stacks */ + /* Let's try to find a suitable parent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ @@ -573,7 +573,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_card /* * We can do it - so let's move everything. * Notice that we only put the child in a different stack - * then the tqparent and let it move to the tqparent in the + * then the parent and let it move to the parent in the * next iteration of the program * */ @@ -743,7 +743,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_with_some_cards_above_to_true (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable tqparent - let's check if we + /* This is a suitable parent - let's check if we * have enough empty stacks to make the move feasible */ for(a=0;a<state_stacks_num;a++) @@ -761,7 +761,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_with_some_cards_above_to_true int clear_junk_dest_stack = -1; - /* Let's try to find a suitable tqparent on top one of the stacks */ + /* Let's try to find a suitable parent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ @@ -1013,7 +1013,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_with_junk_seq_above_to_true_p (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable tqparent - let's check if there's a sequence above it. */ + /* This is a suitable parent - let's check if there's a sequence above it. */ int above_c; fcs_card_t above_card, up_above_card; @@ -1068,7 +1068,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_with_junk_seq_above_to_true_p above_num_true_seqs[false_seq_index] ); - /* Let's try to find a suitable tqparent on top one of the stacks */ + /* Let's try to find a suitable parent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ @@ -1218,7 +1218,7 @@ int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent_w * dest_cards_num - the number of cards in it. * dc - the height of the card in "ds". * num_separate_false_seqs - this variable tells how many distinct false - * sequences exist above the false tqparent + * sequences exist above the false parent * above_num_true_seqs[] - the number of true sequences in each false * sequence * seq_points[] - the separation points of the false sequences (i.e: where @@ -1291,7 +1291,7 @@ int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent_w (fcs_card_card_num(dest_card) == (card_num+1)) ) { - /* This is a suitable tqparent - let's check if there's a sequence above it. */ + /* This is a suitable parent - let's check if there's a sequence above it. */ int above_c; fcs_card_t above_card, up_above_card; @@ -1341,7 +1341,7 @@ int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent_w above_num_true_seqs[false_seq_index]; - /* Let's try to find a suitable tqparent on top one of the stacks */ + /* Let's try to find a suitable parent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ @@ -1380,7 +1380,7 @@ int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent_w if (false_seq_index == num_separate_false_seqs) { - /* This is a suitable tqparent - let's check if we + /* This is a suitable parent - let's check if we * have enough empty stacks to make the move feasible */ if (calc_max_sequence_move(0, num_freestacks) >= num_true_seqs) { @@ -1468,7 +1468,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( cards_num = fcs_stack_len(state, stack); if (cards_num > 2) { - /* Search for a tqparent card */ + /* Search for a parent card */ for(pc=0; pc < cards_num-1 ; pc++) { parent_card = fcs_stack_card(state, stack, pc); @@ -1492,7 +1492,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( ) ) { - /* We have a matching tqparent and child cards */ + /* We have a matching parent and child cards */ #if 0 printf("Stack %i, Parent %i, Child %i\n", stack, pc, cc); fflush(stdout); @@ -1559,7 +1559,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( above_num_true_seqs[num_separate_false_seqs] = child_num_true_seqs; seq_points[num_separate_false_seqs++] = cc; - /* Add the cards between the tqparent and the child to the seq_points */ + /* Add the cards between the parent and the child to the seq_points */ above_card = fcs_stack_card(state, stack, cc-1); above_num_true_seqs[num_separate_false_seqs] = 1; @@ -1599,7 +1599,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack( int clear_junk_dest_stack = -1; - /* Let's try to find a suitable tqparent on top one of the stacks */ + /* Let's try to find a suitable parent on top one of the stacks */ for(clear_junk_dest_stack=0; clear_junk_dest_stack < state_stacks_num; clear_junk_dest_stack++ diff --git a/kpat/freecell-solver/state.h b/kpat/freecell-solver/state.h index 7b312b42..302d6d9a 100644 --- a/kpat/freecell-solver/state.h +++ b/kpat/freecell-solver/state.h @@ -72,7 +72,7 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; int stack_locs[MAX_NUM_STACKS]; int fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * tqparent; + struct fcs_struct_state_with_locations_t * parent; fcs_move_stack_t * moves_to_parent; int depth; int visited; @@ -232,7 +232,7 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; char stack_locs[MAX_NUM_STACKS]; char fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * tqparent; + struct fcs_struct_state_with_locations_t * parent; fcs_move_stack_t * moves_to_parent; int depth; int visited; @@ -484,7 +484,7 @@ struct fcs_struct_state_with_locations_t fcs_state_t s; fcs_locs_t stack_locs[MAX_NUM_STACKS]; fcs_locs_t fc_locs[MAX_NUM_FREECELLS]; - struct fcs_struct_state_with_locations_t * tqparent; + struct fcs_struct_state_with_locations_t * parent; fcs_move_stack_t * moves_to_parent; int depth; /* diff --git a/kpat/freecell-solver/test_arr.h b/kpat/freecell-solver/test_arr.h index 821ccd98..911ff511 100644 --- a/kpat/freecell-solver/test_arr.h +++ b/kpat/freecell-solver/test_arr.h @@ -26,19 +26,19 @@ typedef int (*freecell_solver_solve_for_state_test_t)( extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TESTS_NUM]; /* - * This macro determines if child can be placed above tqparent. + * This macro determines if child can be placed above parent. * * The variable sequences_are_built_by has to be initialized to * the sequences_are_built_by member of the instance. * * */ -#define fcs_is_parent_card(child, tqparent) \ - ((fcs_card_card_num(child)+1 == fcs_card_card_num(tqparent)) && \ +#define fcs_is_parent_card(child, parent) \ + ((fcs_card_card_num(child)+1 == fcs_card_card_num(parent)) && \ ((sequences_are_built_by == FCS_SEQ_BUILT_BY_RANK) ? \ 1 : \ ((sequences_are_built_by == FCS_SEQ_BUILT_BY_SUIT) ? \ - (fcs_card_suit(child) == fcs_card_suit(tqparent)) : \ - ((fcs_card_suit(child) & 0x1) != (fcs_card_suit(tqparent)&0x1)) \ + (fcs_card_suit(child) == fcs_card_suit(parent)) : \ + ((fcs_card_suit(child) & 0x1) != (fcs_card_suit(parent)&0x1)) \ )) \ ) @@ -58,7 +58,7 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST /* Count the number of states until the original state. */ \ while(ptr_state != NULL) \ { \ - ptr_state = ptr_state->tqparent; \ + ptr_state = ptr_state->parent; \ this_real_depth++; \ } \ this_real_depth--; \ @@ -68,14 +68,14 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST { \ ptr_state->depth = this_real_depth; \ this_real_depth--; \ - ptr_state = ptr_state->tqparent; \ + ptr_state = ptr_state->parent; \ } \ } \ } \ /* * This macro marks a state as a dead end, and afterwards propogates - * this information to its tqparent and ancestor states. + * this information to its parent and ancestor states. * */ #define mark_as_dead_end(ptr_state_input) \ { \ @@ -84,7 +84,7 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST fcs_state_with_locations_t * ptr_state = (ptr_state_input); \ /* Mark as a dead end */ \ ptr_state->visited |= FCS_VISITED_DEAD_END; \ - ptr_state = ptr_state->tqparent; \ + ptr_state = ptr_state->parent; \ if (ptr_state != NULL) \ { \ /* Decrease the refcount of the state */ \ @@ -93,8 +93,8 @@ extern freecell_solver_solve_for_state_test_t freecell_solver_sfs_tests[FCS_TEST { \ /* Mark as dead end */ \ ptr_state->visited |= FCS_VISITED_DEAD_END; \ - /* Go to its tqparent state */ \ - ptr_state = ptr_state->tqparent; \ + /* Go to its parent state */ \ + ptr_state = ptr_state->parent; \ if (ptr_state == NULL) \ { \ break; \ diff --git a/kpat/freecell-solver/tests.h b/kpat/freecell-solver/tests.h index fbf78262..0293ed85 100644 --- a/kpat/freecell-solver/tests.h +++ b/kpat/freecell-solver/tests.h @@ -58,7 +58,7 @@ extern "C" { /* Some A* and BFS parameters that need to be initialized in \ * the derived state. \ * */ \ - ptr_new_state_with_locations->tqparent = ptr_state_with_locations; \ + ptr_new_state_with_locations->parent = ptr_state_with_locations; \ ptr_new_state_with_locations->moves_to_parent = moves; \ /* Make sure depth is consistent with the game graph. \ * I.e: the depth of every newly discovered state is derived from \ @@ -103,11 +103,11 @@ fcs_move_stack_push(moves, temp_move); \ { \ fcs_state_ia_release(hard_thread); \ calculate_real_depth(existing_state); \ - /* Re-tqparent the existing state to this one. \ + /* Re-parent the existing state to this one. \ * \ * What it means is that if the depth of the state if it \ * can be reached from this one is lower than what it \ - * already have, then re-assign its tqparent to this state. \ + * already have, then re-assign its parent to this state. \ * */ \ if (reparent && \ (existing_state->depth > ptr_state_with_locations->depth+1)) \ @@ -119,15 +119,15 @@ fcs_move_stack_push(moves, temp_move); \ ); \ if (!(existing_state->visited & FCS_VISITED_DEAD_END)) \ { \ - if ((--existing_state->tqparent->num_active_tqchildren) == 0) \ + if ((--existing_state->parent->num_active_tqchildren) == 0) \ { \ mark_as_dead_end( \ - existing_state->tqparent \ + existing_state->parent \ ); \ } \ ptr_state_with_locations->num_active_tqchildren++; \ } \ - existing_state->tqparent = ptr_state_with_locations; \ + existing_state->parent = ptr_state_with_locations; \ existing_state->depth = ptr_state_with_locations->depth + 1; \ } \ fcs_derived_states_list_add_state( \ |