Skip to content
Snippets Groups Projects
Commit aca1aeb3 authored by Montjoie Henri's avatar Montjoie Henri
Browse files

initialisation de la carte

parent d4d8a87d
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,28 @@
#include <stdlib.h>
#include "structures.h"
Case* init_case(int x, int y, type_terrain t){
Case *c;
c->coord_x=x;
c->coord_y=y;
c->terrain=t;
c->occupee=0;
return c;
}
int init_carte(carte* c,unsigned short int largeur, unsigned short int hauteur){
int i,j,n;
for (i=0;i<largeur;i++){
for (j=0;j<hauteur;j++){
c[n]=init_case(i,j,0);
n++;
}
}
return 0;
}
int main()
{
printf("Hello world!\n");
......
......@@ -14,6 +14,9 @@ typedef struct {
boolean occupee;
} Case;
typedef Case* carte;
typedef struct {
char nom[16];
unsigned short int degats_directs;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment