diff --git a/TaskD00/D00.py b/TaskD00/D00.py new file mode 100644 index 0000000..0c80ee8 --- /dev/null +++ b/TaskD00/D00.py @@ -0,0 +1,28 @@ +import re +import sys + + +def substitute_numbers(string): + result = '' + subs = { + '0': 'a', + '1': 'b', + '2': 'c', + '3': 'd', + '4': 'e', + '5': 'f', + '6': 'g', + '7': 'h', + '8': 'i', + '9': 'j' + } + for char in string: + result += subs[char] + return result + + +regex = r"[0-9]{4}" + +for line in sys.stdin: + line = re.sub(regex, lambda m: substitute_numbers(m.group()), line) + print(line.rstrip('\n')) diff --git a/TaskD00/Makefile b/TaskD00/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/TaskD00/run b/TaskD00/run new file mode 100755 index 0000000..32df26b --- /dev/null +++ b/TaskD00/run @@ -0,0 +1,2 @@ +#!/bin/bash +python3 TaskD00/D00.py "$@" \ No newline at end of file diff --git a/result.csv b/result.csv index 40d583c..6982ce6 100644 --- a/result.csv +++ b/result.csv @@ -1,2 +1,2 @@ POINTS -13 +25