Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
fichier_map.cpp
- Committer:
- dylancachan
- Date:
- 2015-04-15
- Revision:
- 0:6ce9c65992e5
File content as of revision 0:6ce9c65992e5:
#include "all_includes.h"
void affiche_map_terminal(char (*ptr_map)[MAX_X])
{
unsigned char i=0,j=0;
for(i=0;i<MAX_Y;i++)
{
for(j=0;j<MAX_X;j++)
{
DEBUG_PRINTF("%c",(ptr_map[ MAX_Y-1-i][ MAX_X-1-j])*187+32);
}
DEBUG_PRINTF("\n");
}
}
void init_map(char (*ptr_map)[MAX_X])
{
unsigned char i=0;
for(i=1;i<MAX_X-1;i++)
{
ptr_map[00][ i]=1;
}
for(i=0;i<MAX_X;i++)
{
ptr_map[MAX_Y-1][ i]=1;
}
for(i=0;i<MAX_Y;i++)
{
ptr_map[ i][00]=1;
ptr_map[ i][MAX_X-1]=1;
}
// trou représentant le telemetre
ptr_map[(cooYdepart+15)/100][(cooXdepart+75)/100]=0;
// cercle du gateau
ptr_map[0][14]=0;
ptr_map[0][16]=0;
ptr_map[1][14]=1;
ptr_map[1][16]=1;
ptr_map[2][15]=1;
}
void vide_map(char (*ptr_map)[MAX_X])
{
unsigned char i,j;
for(i=1;i<MAX_X-1;i++) // On garde les contours
{
for(j=1;j<MAX_Y-1;j++)// On garde les contours
{
ptr_map[ j][ i]=0;
}
}
// trou représentant le telemetre
ptr_map[(cooYdepart+15)/100][(cooXdepart+75)/100]=0;
// cercle du gateau
ptr_map[0][14]=0;
ptr_map[0][16]=0;
ptr_map[1][14]=1;
ptr_map[1][16]=1;
ptr_map[2][15]=1;
}