From 992de12cc081e7dde16c3c231f83bfa77c67825a Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Thu, 31 Jul 2025 09:47:57 +0200 Subject: Added move sequence comparison function --- src/nissy.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/nissy.h') diff --git a/src/nissy.h b/src/nissy.h index 0c1d18d..38fe656 100644 --- a/src/nissy.h +++ b/src/nissy.h @@ -42,6 +42,10 @@ for example 'rotation UF' or 'mirrored BL'. #define NISSY_STATUS_STOP 1 #define NISSY_STATUS_PAUSE 2 +/* Possible results of move sequence comparison */ +#define NISSY_COMPARE_MOVES_EQUAL 0 +#define NISSY_COMPARE_MOVES_DIFFERENT 99 + /* The solved cube */ #define NISSY_SOLVED_CUBE "ABCDEFGH=ABCDEFGHIJKL=A" @@ -374,6 +378,24 @@ nissy_countmoves( const char *moves ); +/* +Parameters: + moves1 - The first sequence of moves to compare. + moves2 - The second sequence of moves to compare. + +Return values: + NISSY_ERROR_INVALID_MOVES - One of the given moves sequences is invalid. + NISSY_ERROR_NULL_POINTER - One of the arguments is NULL. + NISSY_COMPARE_MOVES_EQUAL - The two moves sequences are indentical, up + to swapping parallel moves. + NISSY_COMPARE_MOVES_DIFFERENT - The two moves sequences are different. +*/ +long long +nissy_comparemoves( + const char *moves1, + const char *moves2 +); + /* Set a global logger function used by this library. Setting the logger to NULL disables logging. -- cgit v1.3