aboutsummaryrefslogtreecommitdiff
path: root/analyzer/utils/roman.c
diff options
context:
space:
mode:
authorMaciej Borowiec <81316152+Mosder@users.noreply.github.com>2026-07-23 20:17:15 +0200
committerGitHub <noreply@github.com>2026-07-23 20:17:15 +0200
commit3419cad016b3c34d0630456d4390c70063462d91 (patch)
tree3a1aa4416e45f134d38f83d4ea2285f1972f9391 /analyzer/utils/roman.c
parent2e3f7fe39791cd671a68330f7ba7a5bb5fc6f9ae (diff)
parent682f9fc8288fdd01de1d88af87495d9e43f56b06 (diff)
LGTM
Diffstat (limited to 'analyzer/utils/roman.c')
-rw-r--r--analyzer/utils/roman.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/analyzer/utils/roman.c b/analyzer/utils/roman.c
new file mode 100644
index 0000000..4fbe5c0
--- /dev/null
+++ b/analyzer/utils/roman.c
@@ -0,0 +1,15 @@
+#include "utils/roman.h"
+
+#include <string.h>
+
+#include "utils/memory.h"
+
+void to_roman(char *buffer, int number) {
+ buffer[0] = '\0';
+ for (size_t i = 0; i < ARR_LEN(roman_symbols); i++) {
+ for (size_t j = 0; j < number / roman_symbols[i].num; j++) {
+ strcat(buffer, roman_symbols[i].symbol);
+ }
+ number %= roman_symbols[i].num;
+ }
+}