commit d4fadc24ee1993104bac7fd854ed6ca83f60ee66
parent f8d247c53c3c3bd94fed645b5b47a9096cadc123
Author: Sebastiano Tronto <sebastiano@tronto.net>
Date: Thu, 10 Oct 2024 15:41:42 +0200
added solve_scramble to shell
Diffstat:
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/shell.c b/shell.c
@@ -69,6 +69,7 @@ static int64_t randomcube_exec(args_t *);
static int64_t datasize_exec(args_t *);
static int64_t gendata_exec(args_t *);
static int64_t solve_exec(args_t *);
+static int64_t solve_scramble_exec(args_t *);
static int64_t help_exec(args_t *);
static int parse_args(int, char **, args_t *);
@@ -196,12 +197,22 @@ struct {
"solve " FLAG_SOLVER " SOLVER"
"[" FLAG_MINMOVES " n] [" FLAG_MAXMOVES " N] "
FLAG_CUBE " CUBE",
- "Solve the given CUBE using SOLVER with the given OPTIONS, "
+ "Solve the given CUBE using SOLVER, "
"using at least n and at most N moves. "
INFO_CUBEFORMAT("CUBE"),
solve_exec
),
COMMAND(
+ "solve_scramble",
+ "solve_scramble " FLAG_SOLVER " SOLVER"
+ "[" FLAG_MINMOVES " n] [" FLAG_MAXMOVES " N] "
+ FLAG_CUBE " CUBE",
+ "Solve the given SCRAMBLE using SOLVER, "
+ "using at least n and at most N moves. "
+ INFO_MOVESFORMAT,
+ solve_scramble_exec
+ ),
+ COMMAND(
"help",
"help [" FLAG_COMMAND " COMMAND]",
"If no COMMAND is specified, prints some generic information "
@@ -498,6 +509,14 @@ solve_exec(args_t *args)
}
static int64_t
+solve_scramble_exec(args_t *args)
+{
+ nissy_frommoves(args->str_moves, args->cube);
+
+ return solve_exec(args);
+}
+
+static int64_t
help_exec(args_t *args)
{
int i;