From 6d4c37d7aa00d282ddf97dc79e808069cc9d152f Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 26 Jan 2026 15:38:33 +0100 Subject: [PATCH] feat(lvl00/ressources): adding the program to test all rot --- level00/ressources/rotX.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 level00/ressources/rotX.c diff --git a/level00/ressources/rotX.c b/level00/ressources/rotX.c new file mode 100644 index 0000000..c27b521 --- /dev/null +++ b/level00/ressources/rotX.c @@ -0,0 +1,20 @@ +#include + +char rotate_char(char c, int rot) { + return (c - 'a' + rot) % 26 + 'a'; +} + +void rotate_string(const char *input, int rot) { + printf("rot%d:\t", rot); + for (int i = 0; input[i] != '\0'; i++) { + printf("%c", rotate_char(input[i], rot)); + } + printf("\n"); +} + +int main() { + char input[] = "cdiiddwpgswtgt"; + for (int rot = 1; rot <= 25; rot++) { + rotate_string(input, rot); + } +}