OSDN Git Service

もう一回訂正
authoryamat0jp <yamat0jp@yahoo.co.jp>
Sat, 28 Apr 2018 02:00:07 +0000 (11:00 +0900)
committeryamat0jp <yamat0jp@yahoo.co.jp>
Sat, 28 Apr 2018 02:00:07 +0000 (11:00 +0900)
グローバルなPaint()関数を素直に使うことにしました

reversi/reversi.py

index fa0b204..9fca394 100644 (file)
@@ -131,9 +131,9 @@ class StoneGrid():
                     break
                 elif s == stone:                                
                     if i > 1:                    
+                        self.effect_stone = stone
                         if (p[1] == False)and(reverse == True):
                             self.item.grid[x][y] = stone
-                            self.effect_stone = stone
                             p[1] = True
                         if reverse == True:                            
                             j = 1
@@ -141,7 +141,7 @@ class StoneGrid():
                             while j <= i-1:
                                 if visible == True:
                                     if ch:
-                                        self.Paint(Effect(x,y))
+                                        Paint()
                                         ch = False
                                     q = Effect(x+m*j,y+n*j)          
                                     self.item.grid[q.Left][q.Top] = effect      
@@ -266,7 +266,7 @@ def ChangePlayer():
             return 'white'
         else:
             index = player1
-            return 'black'        
+            return 'black'  
     
     def Execute():
         for x in range(8):