From 46ce08588a2581a81317ed2dbf7c991637e383f0 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Thu, 24 Aug 2023 18:40:32 +0200 Subject: [PATCH] working example --- .gitignore | 3 ++- 000-999/144/main.py | 15 ------------ README.md | 2 +- {000-999 => exercises}/144/inputs/input | 0 exercises/144/main.py | 15 ++++++++++++ {000-999 => exercises}/147/info.nix | 0 {000-999 => exercises}/147/inputs/flag | 0 {000-999 => exercises}/147/main.py | 2 +- flake.nix | 32 ++++++++++++++++++++++--- 9 files changed, 48 insertions(+), 21 deletions(-) delete mode 100644 000-999/144/main.py rename {000-999 => exercises}/144/inputs/input (100%) create mode 100644 exercises/144/main.py rename {000-999 => exercises}/147/info.nix (100%) rename {000-999 => exercises}/147/inputs/flag (100%) rename {000-999 => exercises}/147/main.py (57%) diff --git a/.gitignore b/.gitignore index 00c1844..8315cca 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.direnv/ \ No newline at end of file +.direnv/ +/result \ No newline at end of file diff --git a/000-999/144/main.py b/000-999/144/main.py deleted file mode 100644 index 55189e2..0000000 --- a/000-999/144/main.py +++ /dev/null @@ -1,15 +0,0 @@ -def rot13(message): - subs = {'A': 'N', 'B': 'O', 'C': 'P', 'D': 'Q', 'E': 'R', 'F': 'S', 'G': 'T', 'H': 'U', 'I': 'V', 'J': 'W', 'K': 'X', 'L': 'Y', 'M': 'Z', 'N': 'A', 'O': 'B', 'P': 'C', 'Q': 'D', 'R': 'E', 'S': 'F', 'T': 'G', 'U': 'H', 'V': 'I', 'W': 'J', 'X': 'K', 'Y': 'L', 'Z': 'M', - 'a': 'N', 'b': 'O', 'c': 'P', 'd': 'Q', 'e': 'R', 'f': 'S', 'g': 'T', 'h': 'U', 'i': 'V', 'j': 'W', 'k': 'X', 'l': 'Y', 'm': 'Z', 'n': 'A', 'o': 'B', 'p': 'C', 'q': 'D', 'r': 'E', 's': 'F', 't': 'G', 'u': 'H', 'v': 'I', 'w': 'J', 'x': 'K', 'y': 'L', 'z': 'M'} - - return ''.join(list(map( - lambda x: subs[x] if x in subs else x, - message - ))) - - -if __name__ == '__main__': - with open('./000-999/144/inputs/input') as file: - input = file.read() - - print(rot13(input)) diff --git a/README.md b/README.md index 17a5d43..f20b1ac 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,4 @@ The folder name is the challenge id, as found in the URL (