Skip to content

Commit

Permalink
Disable/hide the animated/graphic solution display if the game-varian…
Browse files Browse the repository at this point in the history
…t rules do not match 8cols+4reserves freecell
  • Loading branch information
shlomif committed Apr 7, 2024
1 parent 03ff3d7 commit 9c33737
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fc-solve/scripts/Makefile.to-javascript.mak
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,13 @@ NEEDED_FUNCTIONS = \
freecell_solver_user_cmd_line_read_cmd_line_preset \
freecell_solver_user_current_state_stringify \
freecell_solver_user_free \
freecell_solver_user_get_empty_stacks_filled_by \
freecell_solver_user_get_invalid_state_error_into_string \
freecell_solver_user_get_next_move \
freecell_solver_user_get_num_freecells \
freecell_solver_user_get_num_stacks \
freecell_solver_user_get_sequence_move \
freecell_solver_user_get_sequences_are_built_by_type \
freecell_solver_user_get_unrecognized_cmd_line_flag \
freecell_solver_user_get_unrecognized_cmd_line_flag_status \
freecell_solver_user_limit_iterations_long \
Expand Down
34 changes: 34 additions & 0 deletions fc-solve/source/lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -4011,6 +4011,17 @@ int DLLEXPORT freecell_solver_user_set_sequences_are_built_by_type(

return 0;
}

#ifdef FC_SOLVE_JAVASCRIPT_QUERYING
int DLLEXPORT freecell_solver_user_get_sequences_are_built_by_type(
void *const api_instance)
{
return ((((fcs_user *const)api_instance)
->common_preset.game_params.game_flags) &
0x3);
}
#endif

#endif

#ifndef FCS_FREECELL_ONLY
Expand All @@ -4026,6 +4037,17 @@ int DLLEXPORT freecell_solver_user_set_sequence_move(
apply_game_params_for_all_instances(user);
return 0;
}

#ifdef FC_SOLVE_JAVASCRIPT_QUERYING
int DLLEXPORT freecell_solver_user_get_sequence_move(void *const api_instance)
{
return (((((fcs_user *const)api_instance)
->common_preset.game_params.game_flags) >>
4) &
0x1);
}
#endif

#endif

#ifndef FCS_FREECELL_ONLY
Expand All @@ -4043,6 +4065,18 @@ int DLLEXPORT freecell_solver_user_set_empty_stacks_filled_by(
apply_game_params_for_all_instances(user);
return 0;
}

#ifdef FC_SOLVE_JAVASCRIPT_QUERYING
int DLLEXPORT freecell_solver_user_get_empty_stacks_filled_by(
void *const api_instance)
{
return (((((fcs_user *const)api_instance)
->common_preset.game_params.game_flags) >>
2) &
0x3);
}
#endif

#endif

int DLLEXPORT freecell_solver_user_set_a_star_weight(
Expand Down

0 comments on commit 9c33737

Please sign in to comment.