From be4cb583026ab52a33e4bb6e6d67744e2a365ea7 Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Thu, 30 Sep 2021 17:11:25 +0300 Subject: [PATCH 1/9] Create Boryana Stefanova --- Boryana Stefanova | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Boryana Stefanova diff --git a/Boryana Stefanova b/Boryana Stefanova new file mode 100644 index 0000000..9b1aabc --- /dev/null +++ b/Boryana Stefanova @@ -0,0 +1,30 @@ +|Номер| Име | Github | Бонбони | Отсъствия | +|-----|-----|--------|---------|-----------| +|5 | Боряна Стефанова| https://github.com/Boryana23 | 🍬 | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | +|-- | -- | --- | ----- | From 905638ed482782c61240e27220205fc37bdcecb0 Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Mon, 18 Oct 2021 21:15:42 +0300 Subject: [PATCH 2/9] First homework --- circle_checker.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 circle_checker.py diff --git a/circle_checker.py b/circle_checker.py new file mode 100644 index 0000000..81acbb3 --- /dev/null +++ b/circle_checker.py @@ -0,0 +1,23 @@ +from math import sqrt + +def circle(center_1, radius_1, center_2, radius_2); + + a1, b1 = center_1; + a2, b2 = center_2; + distance_between = sqrt((a1 - a2)**2 + (b1 - b2)**2); + radius = (r1 + r2)**2; + + if (center_1 == center_2 and radius_1 == radius_2): + return "MATCHING" + + if (distance_between == radius): + return "TOUCHING" + + if (distance_between > radius_1 + radius_2): + return "DO NOT INTERSECT" + + if (distance_between < radius_1 + radius_2): + return "INTERSECTING" + + if ( radius_1 + distance_between == radius_2 || radius_2 + distance_between == radius_1): + return "CONTAINING" From 1b1fa50c243f00e3df1c5069092d574f8c676cc0 Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Tue, 19 Oct 2021 21:31:00 +0300 Subject: [PATCH 3/9] Update circle_checker.py --- circle_checker.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/circle_checker.py b/circle_checker.py index 81acbb3..5813662 100644 --- a/circle_checker.py +++ b/circle_checker.py @@ -1,23 +1,26 @@ from math import sqrt -def circle(center_1, radius_1, center_2, radius_2); +def CIRCLE_CHECK(center_1, radius_1, center_2, radius_2): - a1, b1 = center_1; - a2, b2 = center_2; - distance_between = sqrt((a1 - a2)**2 + (b1 - b2)**2); - radius = (r1 + r2)**2; + a1, b1 = center_1 + a2, b2 = center_2 + radius = (radius_1 + radius_2) + distance_between = sqrt((a1 - a2)**2 + (b1 - b2)**2) if (center_1 == center_2 and radius_1 == radius_2): - return "MATCHING" - + return "MATCHING" if (distance_between == radius): return "TOUCHING" + if(radius_1 > radius_2): + + if (radius_1 > radius_2 + distance_between): + return "CONTAINING" + else: + if (radius_2 > radius_1 + distance_between): + return "CONTAINING" if (distance_between > radius_1 + radius_2): return "DO NOT INTERSECT" if (distance_between < radius_1 + radius_2): return "INTERSECTING" - - if ( radius_1 + distance_between == radius_2 || radius_2 + distance_between == radius_1): - return "CONTAINING" From d874a372f14ffcddccc3dd3d79d008e873fdeb74 Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Mon, 6 Dec 2021 12:40:43 +0200 Subject: [PATCH 4/9] Adding candy --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3328112..c50aab3 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ $ marp 01.md && open 01.html |1| Авигея Илиева | [AI18527](https://github.com/AI18527) | | | |3| Алекс Гечовски | [AlexGechovski](https://github.com/AlexGechovski) | | | |4| Александра Станчева | [allks12](https://github.com/allks12) | | | -|5| Боряна Стефанова| [Boryana23](https://github.com/Boryana23) | | | +|5| Боряна Стефанова| [Boryana23](https://github.com/Boryana23) |🍬🍬| | |6| Валентин Найденов| [valentinmnaydenov](https://github.com/valentinmnaydenov) | | | |7| Данаил Божков | [DBozhkovV](https://github.com/DBozhkovV) |🍬🍬🍬 | | |8| Даниел Паунов | [McAwesome123](https://github.com/McAwesome123) | | | From 4142e88eaa94f790bce95ce8b8e4bee5245a3c56 Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Wed, 12 Jan 2022 23:13:28 +0200 Subject: [PATCH 5/9] Create 05_Boryana_Stefanova --- homeworks/05_Boryana_Stefanova | 1 + 1 file changed, 1 insertion(+) create mode 100644 homeworks/05_Boryana_Stefanova diff --git a/homeworks/05_Boryana_Stefanova b/homeworks/05_Boryana_Stefanova new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/homeworks/05_Boryana_Stefanova @@ -0,0 +1 @@ + From 2d88f8635f22049fd6fc76c80692332de5afb5e6 Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Wed, 12 Jan 2022 23:23:48 +0200 Subject: [PATCH 6/9] Delete 05_Boryana_Stefanova --- homeworks/05_Boryana_Stefanova | 1 - 1 file changed, 1 deletion(-) delete mode 100644 homeworks/05_Boryana_Stefanova diff --git a/homeworks/05_Boryana_Stefanova b/homeworks/05_Boryana_Stefanova deleted file mode 100644 index 8b13789..0000000 --- a/homeworks/05_Boryana_Stefanova +++ /dev/null @@ -1 +0,0 @@ - From ee9d4d9124c4b0a820bd4a0753710cae21c305fe Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Wed, 12 Jan 2022 23:25:07 +0200 Subject: [PATCH 7/9] Commiting task 2 --- homeworks/05_Boryana_Stefanova/steps_task.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 homeworks/05_Boryana_Stefanova/steps_task.py diff --git a/homeworks/05_Boryana_Stefanova/steps_task.py b/homeworks/05_Boryana_Stefanova/steps_task.py new file mode 100644 index 0000000..7ce17e4 --- /dev/null +++ b/homeworks/05_Boryana_Stefanova/steps_task.py @@ -0,0 +1,13 @@ +def stepCounter(steps): + + if steps < 0: + return 0 + + if steps == 0: + return 1 + + return (stepCounter(steps-1) + + stepCounter(steps-2)) + +steps = 3 +print(stepCounter(steps)) From 913c8b97accc64f53c754da7450f31efb6e78ede Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Wed, 12 Jan 2022 23:26:30 +0200 Subject: [PATCH 8/9] Commiting task 3 --- homeworks/05_Boryana_Stefanova/replace.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 homeworks/05_Boryana_Stefanova/replace.py diff --git a/homeworks/05_Boryana_Stefanova/replace.py b/homeworks/05_Boryana_Stefanova/replace.py new file mode 100644 index 0000000..9b5dab5 --- /dev/null +++ b/homeworks/05_Boryana_Stefanova/replace.py @@ -0,0 +1,16 @@ +def replace(list, find, change): + + counter = 0 + for i in list: + if type(i) != int: + if len(i) > 1: + replace(list[counter], find, change) + + if list[counter] == find: + list[counter] = change + counter = counter + 1 + return list + +list = [ 'a', 1, [ ['a', 'b'], 1], ([1, 3, 'a'], 'b')] +res = replace(list, 'a', 'c') +print(res) From 25db04183bdf2d75f28b74cd08f0cf5337975750 Mon Sep 17 00:00:00 2001 From: Boryana Stefanova <47723617+Boryana23@users.noreply.github.com> Date: Wed, 19 Jan 2022 20:13:59 +0200 Subject: [PATCH 9/9] Commiting first task --- .../05_Boryana_Stefanova/avg_brightness.py | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 homeworks/05_Boryana_Stefanova/avg_brightness.py diff --git a/homeworks/05_Boryana_Stefanova/avg_brightness.py b/homeworks/05_Boryana_Stefanova/avg_brightness.py new file mode 100644 index 0000000..05533f6 --- /dev/null +++ b/homeworks/05_Boryana_Stefanova/avg_brightness.py @@ -0,0 +1,30 @@ +matrix = [ + [1, 2, 3, 4, 5, 6], + [0, 0, 0, 0, 0, 0], + [2, 0, 14, 180, 0, 205], + [0, 0, 85, 0, 184, 0], + [108, 0, 0, 0, 0, 255], + [68, 0, 174, 0, 17, 0] +] + +def blow(matrix, _i, _j): + avg = [] + for i in range(_i - 1, _i + 2): + for j in range(_j - 1, _j + 2): + if i < 0 or j < 0 or i >= len(matrix) or j >= len(matrix[i]): + continue + if matrix[i][j] != 0: + avg.append(matrix[i][j]) + matrix[i][j] = 0 + avg.extend(blow(matrix, i, j)) + return avg + +def avg_brightness(matrix): + for i in range(len(matrix)): + for j in range(len(matrix[i])): + if matrix[i][j] != 0: + avg = blow(matrix, i, j) + result = sum(avg) / len(avg) + print(f"({i}:{j}) = {result:.2f}") + +avg_brightness(matrix)