09_kontrola - najboljsa_cetrt fix

This commit is contained in:
Gašper Dobrovoljc 2023-12-28 11:51:59 +01:00
parent 261eca0fe5
commit 45667c29f9
No known key found for this signature in database
GPG Key ID: 0E7E037018CFA5A5
2 changed files with 3 additions and 3 deletions

View File

@ -131,8 +131,8 @@ def johanca(x, y, pot, zemljevid):
def najboljsa_cetrt(a: int, zemljevid: list[str]):
x_len = len(zemljevid[0]) - a
y_len = len(zemljevid) - a
x_len = len(zemljevid[0]) - a + 1
y_len = len(zemljevid) - a + 1
y_len = y_len if y_len > 0 else 1
max_count = 0

View File

@ -472,7 +472,7 @@ class Test09(NoWarningTest):
def test_najboljsa_cetrt(self):
zemljevid = preberi_zemljevid("dravlje.txt")
self.assertEqual((0, 0), najboljsa_cetrt(4, zemljevid))
self.assertEqual((0, 4), najboljsa_cetrt(4, zemljevid))
self.assertEqual((1, 4), najboljsa_cetrt(2, zemljevid))
zemljevid = preberi_zemljevid("bezigrad.txt")