diff options
author | Benji Dial <benji6283@gmail.com> | 2023-12-28 21:49:47 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2023-12-28 21:49:47 -0500 |
commit | ecbb0627092bf4e77cf211b0b7632f0d2448d025 (patch) | |
tree | a85107992dd4356d911d03a17d9ad613dc6ba0bf /include | |
parent | 3ed235ac0b4faca52a95027e98fcb4d466a699ae (diff) | |
download | lib94-ecbb0627092bf4e77cf211b0b7632f0d2448d025.tar.gz |
add convenience methods and (experimental) evolver
Diffstat (limited to 'include')
-rw-r--r-- | include/lib94/lib94.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/lib94/lib94.hpp b/include/lib94/lib94.hpp index 63f862e..0766af7 100644 --- a/include/lib94/lib94.hpp +++ b/include/lib94/lib94.hpp @@ -147,6 +147,17 @@ namespace lib94 { template <bool update_address_sets> const warrior *single_step(); + //convenience method - reads the contents of a file and then calls compile_warrior. + //if the file cannot be read, returns a null pointer. see comment on compile_warrior. + warrior *compile_warrior_from_file(std::string path); + + //convenience method - calls clear_core(background), then init_round(warriors, count, + //offsets, shuffle), then single_step<false> until either one warrior remains or that + //has been called rounds_to_tie times. if one warrior remains, returns the pointer to + //that warrior. if a tie is reached, returns a null pointer. this asserts that the call + //to init_round returns true. see comment on init_round. + const warrior *do_round(const instruction &background, const warrior *const *warriors, size_t count, const number_t *offsets, bool shuffle, long rounds_to_tie); + } #endif |