echange de pc

This commit is contained in:
2024-11-18 16:15:25 +01:00
parent 16bb47eb28
commit 883aff1bec
6 changed files with 23 additions and 22 deletions

View File

@@ -10,7 +10,7 @@
#include "verificationblock.h"
void compJCJ(int taille){
int compJCJ(int taille){
int fin = 0, tabx = 0, taby = 0, tour = 0, initi = 0, SourisX = 0, SourisY = 0, x = 50, y = 100, initialiser = 0;
int maxX = 0, maxY = 0, joueurx1 = 0, joueury1 = 0, joueurx2 = 0, joueury2 = 0, placer = 1;
int emplacementcooX1 = 0, emplacementcooX2 = 0, emplacementcooY1 = 0, emplacementcooY2 = 0;
@@ -44,12 +44,6 @@ void compJCJ(int taille){
initialiser++;
SourisX = 0;
SourisY = 0;
for(tabx = 0; tabx < taille + 2; tabx++){
for(taby = 0; taby < taille + 2; taby++){
printf("%d", grille[tabx][taby]);
}
printf("\n");
}
Efface();
EcrireTexte(30, 40, "Joueur 2 choisissez l'emplacement de base du pion 2", 1);
}
@@ -68,13 +62,6 @@ void compJCJ(int taille){
}
SourisX = 0;
SourisY = 0;
for(tabx = 0; tabx < taille + 2; tabx++){
for(taby = 0; taby < taille + 2; taby++){
printf("%d", grille[tabx][taby]);
}
printf("\n");
}
}
}
}
@@ -92,8 +79,11 @@ void compJCJ(int taille){
SourisY = _Y;
}
VerifBlock1(SourisX, SourisY, maxX, maxY, taille, empperso);
if(grille[joueury1+1 != 0 && joueury1-1 != 0 && joueurx1+1 != 0 && joueurx1-1 != 0){
printf("\n\nechec\n\n");
}
if(empperso[0] != 0){
if(grille[empperso[1]][empperso[0]] == 0){
if(grille[empperso[1]][empperso[0]] == 0 && (empperso[1] <= joueury1+1 && empperso[1] >= joueury1-1) && (empperso[0] <= joueurx1+1 && empperso[0] >= joueurx1-1)){
grille[joueury1][joueurx1] = 0;
ChoisirCouleurDessin(CouleurParNom("white"));
RemplirRectangle(emplacementcooX1, emplacementcooY1, 40, 40);
@@ -163,7 +153,7 @@ void compJCJ(int taille){
}
VerifBlock1(SourisX, SourisY, maxX, maxY, taille, empperso);
if(empperso[0] != 0){
if(grille[empperso[1]][empperso[0]] == 0){
if(grille[empperso[1]][empperso[0]] == 0 && (empperso[1] <= joueury2+1 && empperso[1] >= joueury2-1) && (empperso[0] <= joueurx2+1 && empperso[0] >= joueurx2-1)){
grille[joueury2][joueurx2] = 0;
ChoisirCouleurDessin(CouleurParNom("white"));
RemplirRectangle(emplacementcooX2, emplacementcooY2, 40, 40);