Commit 11627fcf authored by Fardale's avatar Fardale

Propage pour le premier clique

parent 02afd77f
......@@ -143,28 +143,28 @@ class Demineur {
// Propagation du dévoilement des cases vides
def propage(x: Int, y: Int){
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(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(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(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(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(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(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(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