From e7f8ec11c5a92e36a1b0bebbcf7ddbe72c7d40a1 Mon Sep 17 00:00:00 2001 From: Cory Date: Tue, 21 May 2024 19:11:03 -0400 Subject: [PATCH] I fixed the flickering! And I have an interior! --- __pycache__/cursor.cpython-312.pyc | Bin 1587 -> 1461 bytes __pycache__/free_space.cpython-312.pyc | Bin 14102 -> 13860 bytes __pycache__/mine.cpython-312.pyc | Bin 2624 -> 2450 bytes __pycache__/spawner.cpython-312.pyc | Bin 4305 -> 3314 bytes cursor.py | 10 +++------- free_space.py | 5 +---- mine.py | 7 ++----- spawner.py | 5 +---- 8 files changed, 7 insertions(+), 20 deletions(-) diff --git a/__pycache__/cursor.cpython-312.pyc b/__pycache__/cursor.cpython-312.pyc index 9d714f170ebe776e14b1abee375d7abcf73ce240..7fe97096125097144b4974198fcd494802c9fc5d 100644 GIT binary patch delta 396 zcmdnYvz43oG%qg~0}zxc`KD=4T~2si|SDVTgxu7%DkHP?K}=W~L%ex0fJs zKTWpD8qD$vx5Uy@OX3sLQ}arSFT3jKY&^S>@_wfg&pzz!F6u4;3-P2sR+2SQ<#QFx=o4Zg9CFAl%@2gI~D8;}Z)b ztKw%iVOB$kK9CkaO-6`TWsrW5Jz(R0aoFVMr)=dU}j`w{LUlI N!)W-4L7EX_5CFuzSE>L2 delta 487 zcmYjNPfG$p6rbnr`hQU}sKj!lM7Bcl)~QP!@}Q^aP^Wd>RM>W5cBPa+4}Jlepe|j4 z4ncH@K0>E19ikz5D6dbY)1!e}hRwlAHeB=f z$#Jk9(1L^hH{^K-cHx5G!V-UnJ4kZZR}A^v)1w9WmybymP3D%A=8uvE_k2aZ>5e3_ zSU`wxjS?hU1{T3K28d?=L_&KaBV3anEuIOqv=vqL$@rmMysZww_KB!=(#?7 zY}$3|3DTMAH5_EZtXuX?r=BT8^Q6O~>A*)s~0JHOJ0*)HadnHOzT4qs3f@ zQO`jF=C`q~UC+3P=&c3rcc_qSGhCNTRntj3;`fVJy)*7|Wn!#{RfcoNOq{tPm5w hRl!Nb%~JeQSwQ=G?nv36voq&J>Lt728`AO}F1KLt7+3gS z;8x%4Bsq{8UZ&(@mCbODpO*S#};kE%9+`@1}K)Atk@&q$ARyJ0J YPePM-n|TQaF)?N^eqsPqMZ7>|09p7`?*IS* delta 437 zcmZ3IGcAwrG%qg~0}#C1;F-p!Jdw|b(Pv_`^u!7s$rPRzhA6&DUQNDRoNh&_slf$_ z$*H#(wL&Itd&kH-c`4&oM#0I^OfMM4Cc7~IV3gTx%TmJ2sJwZT;42m;1;)wq#4MPK zl_x)77h@_CpL|h5d~!cC$7FtSK1P%D=@;u0Xy!0>^KK~Qu$??m1iDf4q@=3Wud*`Tsrca!b`m*YMMeJ+GVTylxH zA+6Bi((7}BSFk^}Gj@i_eA}6}S9mp7q^!?fm3x5YINw3O3xPqG9D*){M_&(5z8Ic- zAwB0(c+L%Jd62#j%nT8Xxr`Saf>z{S;MFYR-5et^g_SXE^G8`bLB_Jp2KsMU8Tlv6 znrbl$Pj)s95O4&#tcBr*fN+E74L+d;_sR22)mS-L6+VegK56PD7|O($!T5;*Ocn70 G)dB#SF@>@K diff --git a/__pycache__/mine.cpython-312.pyc b/__pycache__/mine.cpython-312.pyc index 9efde473ffd67e405063a8cdf5c579cc20d17520..6f1828444a0694c9738d4fce3f16e28538c62a21 100644 GIT binary patch delta 202 zcmX>gGD(>4G%qg~0}zC0`lgkzZ{&++W%Qby#cC;0#F4^S!w}B|k_3TDrb;GF<|?nr zjBGM`i3J6ziABW<8Nx zj0T1e91J`H{kEO9GeqXg&Xm2vt$ssVzQd*0=L0hXkH%y<4&}*y><1XtCi8Q|GU`sw p{WT~1pc{i&JUuLmFMrKM%YMw%QMrz*V1I!|^nI(D(AsIjkAj(TkO-W5rD9Kky z%*n|wS18FyRY)!^D$XwgiRI>(rE)1i0gzp!kf=~xkY55at0)!7$<5451sbCVSL8OC zl`X{D9O$wJh7Vi}f}+!TC-TlnnV&l|_lkhd4QYiAmtLP6yn_9)ov|}a=G)G+y~3+` zLs}jr{DGN)Pit}kyYl1(YzG)MCnvJUG8#v-oP3kt z+C&qmVkJY75RfVo01+H8f*Z&v76cM43^(|M8{9v!FtOTv=1^d@o9ro|ny3y^#|k1e zKm;3z0PEEQvEb(Y;;_lhPbtkwwJS0JN-zR(u`H1Iz|6?V_?3r&QTi@}=v@Ydy9|=w OS=1TrJ~03Zuyz36vPSy= delta 1065 zcmZuw%TE(Q7~kEtcH3^-hdK480BXZuJS1rEf7 z6EPFx#e;X_f$$f2HYQ+d((FHAychzvMiakTuqZOg{xaY1_s#d3*@M7d(D%vfb#t)B zwrA5XrEOoE!2hI37~;S0Obd@3bk2F6chRUb$h$4{Fzk}v^Xw4E@m$Kg!M$)+eIY-6 z?W_sSQQ9WSKkfp`G*^F=Ns{rxEq+M%kh>m zU6&uWjJdk}xMjra^6c5hafXP!HHwqyu2Lj*uH>AKFp-Jz}-p?#_@J!nYsR(vzQ z+ZC-#u?GF(xkSHteBE_vyroRmrRbsE?TYdAm*+lzi{6#`yIGAJT*KF~K679f9FaqD z%mEInbUAVZB;sIjlfgL#EH`0Ow3@T7q$x)7da9)2333kv_D357^t06Czs<+^1CF8P F{TtL-CK3Pu diff --git a/cursor.py b/cursor.py index bf3ebc3..34bc846 100644 --- a/cursor.py +++ b/cursor.py @@ -28,10 +28,6 @@ class Cursor: if game.on_board(new_position): if game.is_empty(new_position): self.position = new_position - - def hide(self): - ''' - This is called because I was calling this method based on an agent's location, but I don't need the - cursor to do anything. - ''' - pass \ No newline at end of file + else: + game.get_agents_by_position()[new_position][0].display = False + self.position = new_position \ No newline at end of file diff --git a/free_space.py b/free_space.py index c5565e5..876a39a 100644 --- a/free_space.py +++ b/free_space.py @@ -6,7 +6,6 @@ class FreeSpace: character = '*' - display = True revealed = False neighbors = 0 @@ -77,9 +76,7 @@ class FreeSpace: Make sure a number is hidden when the cursor is over it. This is needed to allow the cursor to move over a spot where a number is. ''' - if (not game.is_empty(self.position)) and self.revealed and self.display == True: - self.display = False - elif game.is_empty(self.position) and self.revealed and self.neighbors > 0 and self.display == False: + if game.is_empty(self.position) and self.revealed and self.display == False: self.display = True diff --git a/mine.py b/mine.py index bd6727a..324b788 100644 --- a/mine.py +++ b/mine.py @@ -30,12 +30,9 @@ class Mine: def play_turn(self, game): ''' - Make sure the mine is hidden when the cursor is over it. This is needed to allow the cursor to move - over a spot where a mine is. + Make sure the mine appears when the cursor is not on it. ''' - if (not game.is_empty(self.position)): - self.display = False - elif game.is_empty(self.position): + if game.is_empty(self.position): self.display = True def reveal(self): diff --git a/spawner.py b/spawner.py index f1a6743..a204348 100644 --- a/spawner.py +++ b/spawner.py @@ -45,9 +45,6 @@ class Spawner: cursor = Cursor((self.board_width - 1, self.board_height - 1)) game.add_agent(cursor) # Print instructions. - game.log("To move, use the arrow keys. You may have to") - game.log("press an arrow key more than once to move.") - game.log("Please make sure the cursor is where you want it") - game.log("before selecting a space. To select a space, ") + game.log("To move, use the arrow keys. To select a space, ") game.log("press return. The game is over when all spots") game.log("with mines are surrounded by numbers.") \ No newline at end of file