diff options
Diffstat (limited to 'src/io/io.c')
-rw-r--r-- | src/io/io.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/io/io.c b/src/io/io.c new file mode 100644 index 0000000..e9f4fb8 --- /dev/null +++ b/src/io/io.c @@ -0,0 +1,13 @@ +#include "io.h" +#include "stdio.h" + +void pattern_nums_to_str(char *str, struct pattern *pattern) +{ + str[0] = 0; + if (pattern->length >= 1) + str += sprintf(str, "%d", pattern_point_to_index(pattern, 0)); + for (int i = 1; i < pattern->length; i++) + { + str += sprintf(str, ",%d", pattern_point_to_index(pattern, i)); + } +}
\ No newline at end of file |