diff --git a/.gitignore b/.gitignore index dd8cec1..9a5595b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,3 @@ -*.class -summary.txt -*~ -*.out -*.far -*.res -report.txt -TaskX02/run -*.jar -*.o -*.pyc -\#* -result.csv \ No newline at end of file +.DS_Store +.idea +.gitignore diff --git a/TaskA01/A01.py b/TaskA01/A01.py new file mode 100644 index 0000000..7c4d6df --- /dev/null +++ b/TaskA01/A01.py @@ -0,0 +1,13 @@ +import sys + + +def line_contain_hamlet(line): + if 'Hamlet' in line: + return True + else: + return False + + +for line in sys.stdin: + if line_contain_hamlet(line): + print(line.rstrip('\n')) \ No newline at end of file diff --git a/TaskA01/run b/TaskA01/run old mode 100644 new mode 100755 index dd06d51..4fee1da --- a/TaskA01/run +++ b/TaskA01/run @@ -1,15 +1,2 @@ -#!/usr/bin/python3 - -import sys - - -def line_contain_hamlet(line): - if 'Hamlet' in line: - return True - else: - return False - - -for line in sys.stdin: - if line_contain_hamlet(line): - print(line.rstrip('\n')) +#!/bin/bash +python3 TaskA01/A01.py "$@" \ No newline at end of file diff --git a/TaskA02/A02.py b/TaskA02/A02.py new file mode 100644 index 0000000..75867bb --- /dev/null +++ b/TaskA02/A02.py @@ -0,0 +1,20 @@ +import sys + + +def contains_pies(string): + string = string.lower() + if string.startswith("pies "): + return True + elif string.endswith(" pies"): + return True + elif " pies " in string: + return True + elif string.rstrip("\n") == "pies": + return True + else: + return False + + +for line in sys.stdin: + if contains_pies(line): + print(line.rstrip("\n")) diff --git a/TaskA02/Makefile b/TaskA02/Makefile new file mode 100644 index 0000000..e69de29 diff --git a/TaskA02/run b/TaskA02/run new file mode 100755 index 0000000..e0be395 --- /dev/null +++ b/TaskA02/run @@ -0,0 +1,2 @@ +#!/bin/bash +python3 TaskA02/A02.py "$@" \ No newline at end of file