---
# System prepended metadata

title: Untitled

---

## grille.cpp

```cpp
#include <iostream>
#include "coord.hpp"
#include "grille.hpp"
#define ASSERT(C) if ( !(C) ) { std::cerr << "Test failed: "#C << std::endl; }

using namespace std;

void initialiseGrilleVide(Grille &g){     //resultat
    for(int i=0; i<20; i++)
        for(int j=0; j<20; j++){
            g.tab[i][j].brindille=0;
            g.tab[i][j].idT=-1;
        }
}

bool estVide (Grille g, Coord c){           //donnees
    if(!g.tab[c.x][c.y].brindille and g.tab[c.x][c.y].idT==-1)
        return 1;
    return 0;
}

bool contienBrindille(Grille g, Coord c){   //donnees
    if(g.tab[c.x][c.y].brindille)
        return 1;
    return 0;
}

short int numeroTermite(Grille g, Coord c){ //donnees
    return g.tab[c.x][c.y].idT;
}

void poseBrindille(Grille &g, Coord c){      //DR, donee
    g.tab[c.x][c.y].brindille=1;
}

void enleveBrindille(Grille &g, Coord c){    //DR, donee
    g.tab[c.x][c.y].brindille=0;
}

void poseTermite(Grille &g, Coord c, Case c1){   //DR, donee
    g.tab[c.x][c.y].idT=c1.idT;
}

void enleveTermite(Grille &g, Coord c){      //DR, donee
    g.tab[c.x][c.y].idT=-1;
}
