//*******************création des lettres et définition de leurs poids*
letter_code[27]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','?'};
int letter_weight[27]={1,3,3,2,1,4,2,4,1,8,10,1,2,1,1,3,8,1,1,1,1,4,10,10,10,10,0};
//*************************************************************************
int int_weight(char letter)
{
int i;
i=(int)letter-65;
return (letter==letter_code[26]?(letter_weight[26])
letter_weight[i]));
}
//*************************************************************************
int str_weight(char letter)
{
char s[3];
sprintf(s,"%i\0",int_weight(letter));
ST_showHelp(s);
wait(200000);
return s;
}
//************************************************************************
void show_letter(int player_current)
{
int i,j,n;
n=playerlist[player_current].letter_count;
ScrRectFill (&(SCR_RECT){{LX_TOP,LY_TOP,LX_BCK,LY_BCK}}, ScrRect, 0);
for((i=LX_TOP,j=0);i<LX_BCK;(i+=LX_WIDTH,j++))
{
FontSetSys (FONT_L);
DrawChar(i+LX_OFFSET,LY_TOP+LY_OFFSET,playerlist[player_current].letter[j],4);
FontSetSys (FONT_S);
++++++++++++++++++++++++++++++++++++++++++++++++++++++
// ça affiche des caratères bizarres au lieu d'afficher le poids des lettres //
++++++++++++++++++++++++++++++++++++++++++++++++++++++
DrawStr(i+LX_WIDTH-LX_OFFSET_WEIGHT,LY_BCK-LY_OFFSET_WEIGHT,str_weight(playerlist[player_current].letter[j]),4);
}
FontSetSys (USE_FONT);
}
l'erreur doit être dans le dernier Appel de DrawStr() puisque le ST_showHelp de la fonction str_weigth montre que la récupération est correcte.
C'est à en perdre la tête !