Skip to content

Commit

Permalink
Added count of steps function.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmlacak committed Nov 24, 2023
1 parent cff4541 commit 512ca2b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ converted to UTC for easier comparison.
**Application** and **library versions** can be seen in an application, using `version` command. \
The latest versions are:

Application: 0.0.1.425:857+20231124.034927 <!--- readme-new-app-version-major-minor-feature-commit+meta~breaks-place-marker --> \
Library: 0.0.1.425:857+20231124.034927 <!--- readme-new-lib-version-major-minor-feature-commit+meta~breaks-place-marker -->
Application: 0.0.1.426:858+20231124.040129 <!--- readme-new-app-version-major-minor-feature-commit+meta~breaks-place-marker --> \
Library: 0.0.1.426:858+20231124.040129 <!--- readme-new-lib-version-major-minor-feature-commit+meta~breaks-place-marker -->

Versioning used is [Natural Versioning 1.2](https://croatian-chess.blogspot.com/p/natver.html),
with meta data containing the same format as the book version.
Expand Down
2 changes: 1 addition & 1 deletion ws/crochess/src/crochess.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "crochess.h"


char const CROCHESS_VERSION[] = "0.0.1.425:857+20231124.034927"; // source-new-crochess-version-major-minor-feature-commit+meta~breaks-place-marker
char const CROCHESS_VERSION[] = "0.0.1.426:858+20231124.040129"; // source-new-crochess-version-major-minor-feature-commit+meta~breaks-place-marker

#ifdef __WITH_LINE_NOISE__
char const CROCHESS_HISTORY_FILE_NAME[] = "history_crochess.txt";
Expand Down
17 changes: 17 additions & 0 deletions ws/libcrochess/src/cc_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,23 @@ static bool cc_path_weak_get_next_route( CcPathNode * restrict path_node,
return false;
}

static size_t cc_path_weak_count_of_steps( CcPathWeak * restrict path_weak ) {
if ( !path_weak ) return 0;
if ( !cc_path_weak_check_if_valid( path_weak ) ) return 0;

size_t count = 0;
CcPathWeak * pw = path_weak;

CC_REWIND( pw );

while ( pw ) {
count += cc_ppt_link_len( pw->node__w->path );
pw = pw->next;
}

return count;
}


//
// Auxilary functions.
Expand Down
2 changes: 1 addition & 1 deletion ws/libcrochess/src/cc_version.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
*/


char const CC_LIB_VERSION[] = "0.0.1.425:857+20231124.034927"; // source-new-libcrochess-version-major-minor-feature-commit+meta~breaks-place-marker
char const CC_LIB_VERSION[] = "0.0.1.426:858+20231124.040129"; // source-new-libcrochess-version-major-minor-feature-commit+meta~breaks-place-marker
2 changes: 1 addition & 1 deletion ws/tests/src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "tests.h"


char const CROCHESS_TESTS_VERSION[] = "0.0.1.425:857+20231124.034927"; // source-new-crochess-tests-version-major-minor-feature-commit+meta~breaks-place-marker
char const CROCHESS_TESTS_VERSION[] = "0.0.1.426:858+20231124.040129"; // source-new-crochess-tests-version-major-minor-feature-commit+meta~breaks-place-marker

#ifdef __WITH_LINE_NOISE__
char const CROCHESS_TESTS_HISTORY_FILE_NAME[] = "history_tests.txt";
Expand Down

0 comments on commit 512ca2b

Please sign in to comment.