1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#include <stdio.h>
#define ver 16
#define hor 16
void board();
char tab[ver][hor];
main()
{
int cpt01;
int cpt02;
board();
for(cpt01=0 ; cpt01<(ver+1) ; cpt01++)
{
for(cpt02=0 ; cpt02<(hor+1) ; cpt02++)
{
if(cpt02==ver)
{
printf("%c\n", tab[cpt01][cpt02]);
}
else
{
printf("%c", tab[cpt01][cpt02]);
}
}
}
}
void board()
{
int cpt1;
int cpt2;
for(cpt1=0 ; cpt1<(ver+1) ; cpt1++)
{
for(cpt2=0 ; cpt2<(hor+1) ; cpt2++)
{
if((cpt1&2)==0)
{
if((cpt2%2)==0)
{
tab[cpt1][cpt2]=' ';
}
else
{
tab[cpt1][cpt2]='_';
}
}
else
{
if((cpt2%2)==0)
{
tab[cpt1][cpt2]='|';
}
else
{
tab[cpt1][cpt2]=' ';
}
}
}
}
} |
Partager