From d4fadc24ee1993104bac7fd854ed6ca83f60ee66 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 10 Oct 2024 15:41:42 +0200 Subject: added solve_scramble to shell --- shell.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'shell.c') diff --git a/shell.c b/shell.c index dbdb698..efff70b 100644 --- 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,11 +197,21 @@ 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]", @@ -497,6 +508,14 @@ solve_exec(args_t *args) return 0; } +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) { -- cgit v1.3