~ubuntu-branches/ubuntu/natty/freecell-solver/natty

« back to all changes in this revision

Viewing changes to simpsim.c

  • Committer: Bazaar Package Importer
  • Author(s): RISKO Gergely
  • Date: 2009-03-15 23:42:21 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090315234221-sx95hxyfyfgi0pja
Tags: 2.16.0-1
* Imported Upstream version 2.16.0 (closes: #518440)
* cmake is the new buildsystem

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * simpsim.c - a module that contains Simple Simon Moves.
3
3
 *
4
 
 * Written by Shlomi Fish (shlomif@vipe.technion.ac.il), 2001
 
4
 * Written by Shlomi Fish ( http://www.shlomifish.org/ ), 2001
5
5
 *
6
6
 * This file is in the public domain (it's uncopyrighted).
7
7
 */
31
31
        (fcs_suit_is_ss_true_parent(fcs_card_suit(parent),fcs_card_suit(child))) \
32
32
    )
33
33
 
34
 
/*
35
 
 *  Those are some macros to make it easier for the programmer.
36
 
 * */
37
 
#define state_with_locations (*ptr_state_with_locations)
38
 
#define state (ptr_state_with_locations->s)
39
 
#define new_state_with_locations (*ptr_new_state_with_locations)
40
 
#define new_state (ptr_new_state_with_locations->s)
41
 
 
42
 
 
43
 
 
44
 
int freecell_solver_sfs_simple_simon_move_sequence_to_founds(
45
 
        freecell_solver_soft_thread_t * soft_thread,
46
 
        fcs_state_with_locations_t * ptr_state_with_locations,
 
34
int fc_solve_sfs_simple_simon_move_sequence_to_founds(
 
35
        fc_solve_soft_thread_t * soft_thread,
 
36
        fcs_state_t * ptr_state_key,
 
37
        fcs_state_extra_info_t * ptr_state_val,
47
38
        int num_freestacks,
48
39
        int num_freecells,
49
40
        fcs_derived_states_list_t * derived_states_list,
129
120
    return FCS_STATE_IS_NOT_SOLVEABLE;
130
121
}
131
122
 
132
 
int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent(
133
 
        freecell_solver_soft_thread_t * soft_thread,
134
 
        fcs_state_with_locations_t * ptr_state_with_locations,
 
123
int fc_solve_sfs_simple_simon_move_sequence_to_true_parent(
 
124
        fc_solve_soft_thread_t * soft_thread,
 
125
        fcs_state_t * ptr_state_key,
 
126
        fcs_state_extra_info_t * ptr_state_val,
135
127
        int num_freestacks,
136
128
        int num_freecells,
137
129
        fcs_derived_states_list_t * derived_states_list,
252
244
    return FCS_STATE_IS_NOT_SOLVEABLE;
253
245
}
254
246
 
255
 
int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent(
256
 
        freecell_solver_soft_thread_t * soft_thread,
257
 
        fcs_state_with_locations_t * ptr_state_with_locations,
 
247
int fc_solve_sfs_simple_simon_move_whole_stack_sequence_to_false_parent(
 
248
        fc_solve_soft_thread_t * soft_thread,
 
249
        fcs_state_t * ptr_state_key,
 
250
        fcs_state_extra_info_t * ptr_state_val,
258
251
        int num_freestacks,
259
252
        int num_freecells,
260
253
        fcs_derived_states_list_t * derived_states_list,
360
353
}
361
354
 
362
355
 
363
 
int freecell_solver_sfs_simple_simon_move_sequence_to_true_parent_with_some_cards_above(
364
 
        freecell_solver_soft_thread_t * soft_thread,
365
 
        fcs_state_with_locations_t * ptr_state_with_locations,
 
356
int fc_solve_sfs_simple_simon_move_sequence_to_true_parent_with_some_cards_above(
 
357
        fc_solve_soft_thread_t * soft_thread,
 
358
        fcs_state_t * ptr_state_key,
 
359
        fcs_state_extra_info_t * ptr_state_val,
366
360
        int num_freestacks,
367
361
        int num_freecells,
368
362
        fcs_derived_states_list_t * derived_states_list,
636
630
    return FCS_STATE_IS_NOT_SOLVEABLE;
637
631
}
638
632
 
639
 
int freecell_solver_sfs_simple_simon_move_sequence_with_some_cards_above_to_true_parent(
640
 
        freecell_solver_soft_thread_t * soft_thread,
641
 
        fcs_state_with_locations_t * ptr_state_with_locations,
 
633
int fc_solve_sfs_simple_simon_move_sequence_with_some_cards_above_to_true_parent(
 
634
        fc_solve_soft_thread_t * soft_thread,
 
635
        fcs_state_t * ptr_state_key,
 
636
        fcs_state_extra_info_t * ptr_state_val,
642
637
        int num_freestacks,
643
638
        int num_freecells,
644
639
        fcs_derived_states_list_t * derived_states_list,
873
868
    return FCS_STATE_IS_NOT_SOLVEABLE;
874
869
}
875
870
 
876
 
int freecell_solver_sfs_simple_simon_move_sequence_with_junk_seq_above_to_true_parent_with_some_cards_above(
877
 
        freecell_solver_soft_thread_t * soft_thread,
878
 
        fcs_state_with_locations_t * ptr_state_with_locations,
 
871
int fc_solve_sfs_simple_simon_move_sequence_with_junk_seq_above_to_true_parent_with_some_cards_above(
 
872
        fc_solve_soft_thread_t * soft_thread,
 
873
        fcs_state_t * ptr_state_key,
 
874
        fcs_state_extra_info_t * ptr_state_val,
879
875
        int num_freestacks,
880
876
        int num_freecells,
881
877
        fcs_derived_states_list_t * derived_states_list,
1190
1186
    return FCS_STATE_IS_NOT_SOLVEABLE;
1191
1187
}
1192
1188
 
1193
 
int freecell_solver_sfs_simple_simon_move_whole_stack_sequence_to_false_parent_with_some_cards_above(
1194
 
        freecell_solver_soft_thread_t * soft_thread,
1195
 
        fcs_state_with_locations_t * ptr_state_with_locations,
 
1189
int fc_solve_sfs_simple_simon_move_whole_stack_sequence_to_false_parent_with_some_cards_above(
 
1190
        fc_solve_soft_thread_t * soft_thread,
 
1191
        fcs_state_t * ptr_state_key,
 
1192
        fcs_state_extra_info_t * ptr_state_val,
1196
1193
        int num_freestacks,
1197
1194
        int num_freecells,
1198
1195
        fcs_derived_states_list_t * derived_states_list,
1432
1429
    return FCS_STATE_IS_NOT_SOLVEABLE;
1433
1430
}
1434
1431
 
1435
 
int freecell_solver_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack(
1436
 
        freecell_solver_soft_thread_t * soft_thread,
1437
 
        fcs_state_with_locations_t * ptr_state_with_locations,
 
1432
int fc_solve_sfs_simple_simon_move_sequence_to_parent_on_the_same_stack(
 
1433
        fc_solve_soft_thread_t * soft_thread,
 
1434
        fcs_state_t * ptr_state_key,
 
1435
        fcs_state_extra_info_t * ptr_state_val,
1438
1436
        int num_freestacks,
1439
1437
        int num_freecells,
1440
1438
        fcs_derived_states_list_t * derived_states_list,