diff options
| author | Mosder <xmosder12@gmail.com> | 2026-07-21 17:26:09 +0200 |
|---|---|---|
| committer | Mosder <xmosder12@gmail.com> | 2026-07-21 17:26:09 +0200 |
| commit | 5c0e713713143bad475a92d20ee5fe215b5bafd3 (patch) | |
| tree | 2f0dfb464b46181644f28a6be59a88f2ef6305d4 /analyzer/utils/roman.c | |
| parent | f73349115edbc75021885eefd33ee33ee504d9a7 (diff) | |
feat: added parsing for gear
Diffstat (limited to 'analyzer/utils/roman.c')
| -rw-r--r-- | analyzer/utils/roman.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/analyzer/utils/roman.c b/analyzer/utils/roman.c new file mode 100644 index 0000000..9ea2bbb --- /dev/null +++ b/analyzer/utils/roman.c @@ -0,0 +1,16 @@ +#include "utils/roman.h" + +#include <stddef.h> +#include <string.h> + +void to_roman(char *buffer, int number) { + buffer[0] = '\0'; + int nums[ROMAN_CHAR_COUNT] = ROMAN_NUMS; + char *chars[ROMAN_CHAR_COUNT] = ROMAN_CHARS; + for (size_t i = 0; i < ROMAN_CHAR_COUNT; i++) { + for (size_t j = 0; j < number / nums[i]; j++) { + strcat(buffer, chars[i]); + } + number %= nums[i]; + } +} |
