summaryrefslogtreecommitdiffstats
path: root/kpat/freecell-solver/simpsim.c
diff options
context:
space:
mode:
Diffstat (limited to 'kpat/freecell-solver/simpsim.c')
-rw-r--r--kpat/freecell-solver/simpsim.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/kpat/freecell-solver/simpsim.c b/kpat/freecell-solver/simpsim.c
index f603ba39..a51b0c50 100644
--- a/kpat/freecell-solver/simpsim.c
+++ b/kpat/freecell-solver/simpsim.c
@@ -19,16 +19,16 @@
#endif
-#define fcs_is_ss_false_parent(parent, child) \
- (fcs_card_card_num(parent) == fcs_card_card_num(child)+1)
+#define fcs_is_ss_false_parent(tqparent, child) \
+ (fcs_card_card_num(tqparent) == fcs_card_card_num(child)+1)
-#define fcs_suit_is_ss_true_parent(parent_suit, child_suit) \
- ((parent_suit) == (child_suit))
+#define fcs_suit_is_ss_true_parent(tqparent_suit, child_suit) \
+ ((tqparent_suit) == (child_suit))
-#define fcs_is_ss_true_parent(parent, child) \
+#define fcs_is_ss_true_parent(tqparent, child) \
( \
- fcs_is_ss_false_parent(parent,child) && \
- (fcs_suit_is_ss_true_parent(fcs_card_suit(parent),fcs_card_suit(child))) \
+ fcs_is_ss_false_parent(tqparent,child) && \
+ (fcs_suit_is_ss_true_parent(fcs_card_suit(tqparent),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
- * parent on top one of the stacks */
+ * tqparent 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 parent - let's check if we
+ /* This is a suitable tqparent - 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 parent - let's check if we
+ /* This is a suitable tqparent - 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 parent
+ * sequences exist above the true tqparent
* 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 parent - let's check if there's a sequence above it. */
+ /* This is a suitable tqparent - 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 parent on top one of the stacks */
+ /* Let's try to find a suitable tqparent 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 parent and let it move to the parent in the
+ * then the tqparent and let it move to the tqparent 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 parent - let's check if we
+ /* This is a suitable tqparent - 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 parent on top one of the stacks */
+ /* Let's try to find a suitable tqparent 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 parent - let's check if there's a sequence above it. */
+ /* This is a suitable tqparent - 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 parent on top one of the stacks */
+ /* Let's try to find a suitable tqparent 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 parent
+ * sequences exist above the false tqparent
* 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 parent - let's check if there's a sequence above it. */
+ /* This is a suitable tqparent - 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 parent on top one of the stacks */
+ /* Let's try to find a suitable tqparent 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 parent - let's check if we
+ /* This is a suitable tqparent - 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)
{
@@ -1450,7 +1450,7 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack(
int check;
int stack, cards_num, pc, cc;
- fcs_card_t parent_card, child_card;
+ fcs_card_t tqparent_card, child_card;
int a;
int after_junk_num_freestacks;
int false_seq_index;
@@ -1468,13 +1468,13 @@ 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 parent card */
+ /* Search for a tqparent card */
for(pc=0; pc < cards_num-1 ; pc++)
{
- parent_card = fcs_stack_card(state, stack, pc);
+ tqparent_card = fcs_stack_card(state, stack, pc);
if (
fcs_is_ss_true_parent(
- parent_card,
+ tqparent_card,
fcs_stack_card(state, stack, pc+1)
)
)
@@ -1487,12 +1487,12 @@ int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack(
{
child_card = fcs_stack_card(state, stack, cc);
if (fcs_is_ss_true_parent(
- parent_card,
+ tqparent_card,
child_card
)
)
{
- /* We have a matching parent and child cards */
+ /* We have a matching tqparent 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 parent and the child to the seq_points */
+ /* Add the cards between the tqparent 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 parent on top one of the stacks */
+ /* Let's try to find a suitable tqparent on top one of the stacks */
for(clear_junk_dest_stack=0;
clear_junk_dest_stack < state_stacks_num;
clear_junk_dest_stack++