From ccb752c751fd194dd4249424f9034c794db60818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konrad=20Pierzy=C5=84ski?= Date: Mon, 1 Apr 2019 14:32:24 +0200 Subject: [PATCH 1/3] Poprawiono problem z generowaniem map --- DataModels/GC.py | 8 +++++++- main.py | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/DataModels/GC.py b/DataModels/GC.py index 64dac80..6fc37d0 100644 --- a/DataModels/GC.py +++ b/DataModels/GC.py @@ -1,5 +1,11 @@ from DataModels.Cell import Cell +from DataModels.House import House class GC( Cell ): def __init__( self, x, y, max_rubbish, yellow = 0, green = 0, blue = 0): - Cell.__init__(self, x, y, max_rubbish, yellow, green, blue ) \ No newline at end of file + Cell.__init__(self, x, y, max_rubbish, yellow, green, blue ) + + + + + diff --git a/main.py b/main.py index 864acd7..9fa4a90 100644 --- a/main.py +++ b/main.py @@ -18,7 +18,7 @@ map = open(sys.argv[1], 'r') map.readline() map.readline() -map_objects = [ [ None for y in range(0,GRID_WIDTH)] for x in range(0, GRID_HEIGHT)] +map_objects = [ [ None for y in range(0,GRID_HEIGHT)] for x in range(0, GRID_WIDTH)] def generate( letter ): key = 'D' if letter in ['B','G','Y'] else letter @@ -34,9 +34,9 @@ def generate( letter ): i = 0 for y in map.readlines(): for x in y.split(): - - y_coord = i % GRID_WIDTH - x_coord = (i - y_coord)//GRID_WIDTH + + x_coord = i%GRID_WIDTH + y_coord = (i-x_coord)//GRID_WIDTH yellow, green, blue = [randint(0, HOUSE_CAPACITY //2),randint(0, HOUSE_CAPACITY //2),randint(0, HOUSE_CAPACITY //2)] if x is 'E': From 8542676d154eedbb6248caad2fe47ed121c661fb Mon Sep 17 00:00:00 2001 From: Adnovac Date: Mon, 1 Apr 2019 14:34:53 +0200 Subject: [PATCH 2/3] naprawiono mapy --- DataModels/__pycache__/Cell.cpython-36.pyc | Bin 1429 -> 1431 bytes .../__pycache__/Container.cpython-36.pyc | Bin 807 -> 809 bytes DataModels/__pycache__/Dump.cpython-36.pyc | Bin 599 -> 601 bytes DataModels/__pycache__/GC.cpython-36.pyc | Bin 562 -> 610 bytes DataModels/__pycache__/Grass.cpython-36.pyc | Bin 657 -> 659 bytes DataModels/__pycache__/House.cpython-36.pyc | Bin 571 -> 573 bytes DataModels/__pycache__/Road.cpython-36.pyc | Bin 653 -> 655 bytes Resources/Maps/map_003.txt | 6 +++--- Resources/Maps/map_004.txt | 2 +- __pycache__/config.cpython-36.pyc | Bin 689 -> 691 bytes 10 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DataModels/__pycache__/Cell.cpython-36.pyc b/DataModels/__pycache__/Cell.cpython-36.pyc index 186a46b1c87e325960c76dc59c0b22276288360a..df1d17494049f0c33c61240f0b80aa7143d0cbdb 100644 GIT binary patch delta 74 zcmbQrJ)N7)n3tEU@c%}(|BR;5`WgATsrtnwr75X-CB^#1CdMY_W(N8$sm0kP`33sH dRVAg#Re6aDnRz9tIhpCHdC6Icn=P1PnE|O?8KwXL delta 72 zcmbQvJ(Ziyn3tEU@WV#7|BS|w`WgATsrtnwr75X-CB^#1CMHJ4#>ViZ&Yq4z-j18Cm|~d$RNWTa diff --git a/DataModels/__pycache__/Container.cpython-36.pyc b/DataModels/__pycache__/Container.cpython-36.pyc index 391e59b9afa1d1030ded2a7b4fb95e771545ddb1..763ff9a81e0ec5be3702d3e1419f142427b781c2 100644 GIT binary patch delta 73 zcmZ3^wvvs_n3tEU@c%@%H>L^t8Tq-X`o$%sDXDoS#rnl2#wO-w2Kp|k#n~nK1^U5N cC8fz#d5H>{c_pbindzx{$yte;RT-I>0H2*1ApigX delta 71 zcmZ3)Z*-t`~v;p cs*=*=s=P#n%)FA+oXqspyyUFJ$ViZ&Yq4z-j0)F8UFwPL7^9D diff --git a/DataModels/__pycache__/GC.cpython-36.pyc b/DataModels/__pycache__/GC.cpython-36.pyc index 8136c1d4b3426d2a9e8d8951a94e60a053c81f26..9ed3f4085e3a97057b0cd0eb078807269038c4af 100644 GIT binary patch delta 333 zcmdnQ@`$D0n3tF9Da)dmZww3!kAWBtSb!`CATHJc5-AKRj5!Rsj8Tk?AU0DDQ!aB9 zGb4jLLke>WOAA8^ODbbCa}-MoYcPW*+e@Gh22I9WEY7JpIY64#BfqpbH5nud1I$2% z0}xNlT4==!q<=-~XXNLm>KB)krljVT6zdn87@L@z8R)yD7H5~_7w899m6Rq|&Tr{?5L%-Uwb1LXe-*U!k$P1P?hDNRYuD=F45 zHZd_WHa6CGNiEJU$uH0kjtU8Nj`DMi5BBwRb@p@&@^+jY#i+&#vYcgdD`P+jh*bnK z3yI(bahZVx2p2N}2@Xau-%peI7QahkNuqClN@`BA9>^_4AbGGXk_lh~LB`zTu*uC& ODa}c>V}zN-!vp{>2{{=6 diff --git a/DataModels/__pycache__/Grass.cpython-36.pyc b/DataModels/__pycache__/Grass.cpython-36.pyc index e0e9c6735ce47ecacfdbf9fab91f13385630581c..9a35abd13ba6681db9f7db61268b33db1400d689 100644 GIT binary patch delta 73 zcmbQpI+>Ntn3tEU@c%}(Oh(ff{fzwFRQ=+T(v;M^l4AX06Jrx|GXs5>)Z*-t`~v;p ds*=*=s=P#n%)FA+oXqspyyUFJ$%`1@0|01(8Pxy) delta 71 zcmbQtI+2yln3tF9;IoZvnT*C!`WgATsrtnwr75X-CB^#1CMHJ4#>ViZ&Yq4z-j0)(Fun%>DIFJ3 diff --git a/DataModels/__pycache__/House.cpython-36.pyc b/DataModels/__pycache__/House.cpython-36.pyc index c33f3005448e0a6ec78dcfb53ad1ed673a283a35..42fcedfa0997998a97a701dd9ddcfc7b09b5bb62 100644 GIT binary patch delta 73 zcmdnZvX_O;n3tEU@c%|OUPjXx{fzwFRQ=+T(v;M^l4AX06Jrx|GXs5>)Z*-t`~v;p cs*=*=s=P#n%)FA+oXqspyyUFJ$!?5a0ciFabpQYW delta 71 zcmdnXvYUm?n3tDJ=J`f8UPj|6{fzwFRQ=+T(v;M^l4AX06B8q2V`F`n)Z*-t`~v;p asE|=sM_ diff --git a/DataModels/__pycache__/Road.cpython-36.pyc b/DataModels/__pycache__/Road.cpython-36.pyc index db9525cedc5f8c72195565379175096d6a030241..d7afbc056127b75ca2fb214613a954ae3978b901 100644 GIT binary patch delta 73 zcmeBW?Pp~(=H=xo{J)VcozXN}KO;XkRlm5TG$l2!q*%Y$#Ms2#%s}5IwK%&Zzd%2@ cs-!fzDlbtXGp{5yCo?@YFF7l5@&d-U0A-08#sB~S delta 71 zcmeBY?PX;%=H=yD`g|i>I-_x)Z*-t`~v;p ds*=*=s=P#n%)FA+oXqspyyUFJ%~p)%i~x6>7~}u| delta 72 zcmdnYx{;O5n3tF9{ojpjjEu$s`WgATsrtnwr75X-CB^#1CMHJ4#>ViZ&Yq4z-j17X7|R&}M*0?{ From 5e7d2e91110d5830d023c3ebe7022472e65a2a71 Mon Sep 17 00:00:00 2001 From: Adnovac Date: Mon, 1 Apr 2019 14:37:14 +0200 Subject: [PATCH 3/3] Naprawiono ostatnia mape --- Resources/Maps/map_000.txt | 3 --- Resources/Maps/map_001.txt | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 Resources/Maps/map_000.txt diff --git a/Resources/Maps/map_000.txt b/Resources/Maps/map_000.txt deleted file mode 100644 index c6fbefd..0000000 --- a/Resources/Maps/map_000.txt +++ /dev/null @@ -1,3 +0,0 @@ -2 2 -E H -H Y diff --git a/Resources/Maps/map_001.txt b/Resources/Maps/map_001.txt index 4c03fdc..c41c4f9 100644 --- a/Resources/Maps/map_001.txt +++ b/Resources/Maps/map_001.txt @@ -3,9 +3,9 @@ E E E H E E E E E E Y R R E H E E E E R E R E R E G E -E R H R R R R R E -H R E H R H E R E +H R E R R R R R E +H R E E R H E R E R R R R R E R R E E B R H E R R H E E E R R R R E E E -E E E E H R R R H +E E H E H R R R H