Commit f5a002c7 authored by Fardale's avatar Fardale
Browse files

Merge branch 'master' of gitlab.crans.org:arrighi/prog2

parents dafc8aa7 11627fcf
...@@ -143,28 +143,28 @@ class Demineur { ...@@ -143,28 +143,28 @@ class Demineur {
// Propagation du dévoilement des cases vides // Propagation du dévoilement des cases vides
def propage(x: Int, y: Int){ def propage(x: Int, y: Int){
if (x > 0) { if (x > 0) {
if(boutons(x-1)(y).enabled){clique_action(x-1,y)} if(boutons(x-1)(y).enabled && champ(x-1)(y) != 9){clique_action(x-1,y)}
if(y > 0){ if(y > 0){
if(boutons(x-1)(y-1).enabled){clique_action(x-1,y-1)} if(boutons(x-1)(y-1).enabled && champ(x-1)(y-1) != 9){clique_action(x-1,y-1)}
} }
if(y < tailleY-1){ if(y < tailleY-1){
if(boutons(x-1)(y+1).enabled){clique_action(x-1,y+1)} if(boutons(x-1)(y+1).enabled && champ(x-1)(y+1) != 9){clique_action(x-1,y+1)}
} }
} }
if (x < tailleX-1) { if (x < tailleX-1) {
if(boutons(x+1)(y).enabled){clique_action(x+1,y)} if(boutons(x+1)(y).enabled && champ(x+1)(y) != 9){clique_action(x+1,y)}
if(y > 0){ if(y > 0){
if(boutons(x+1)(y-1).enabled){clique_action(x+1,y-1)} if(boutons(x+1)(y-1).enabled && champ(x+1)(y-1) != 9){clique_action(x+1,y-1)}
} }
if(y < tailleY-1){ if(y < tailleY-1){
if(boutons(x+1)(y+1).enabled){clique_action(x+1,y+1)} if(boutons(x+1)(y+1).enabled && champ(x+1)(y+1) != 9){clique_action(x+1,y+1)}
} }
} }
if(y>0){ if(y>0){
if(boutons(x)(y-1).enabled){clique_action(x,y-1)} if(boutons(x)(y-1).enabled && champ(x)(y-1) != 9){clique_action(x,y-1)}
} }
if(y<tailleY-1){ if(y<tailleY-1){
if(boutons(x)(y+1).enabled){clique_action(x,y+1)} if(boutons(x)(y+1).enabled && champ(x)(y+1) != 9){clique_action(x,y+1)}
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment