im making a game in delhi n its a hangman game n it all works but my letters dont appear in place of my question marks. can anyone look at my code for n see wat is wrong wit. ps i have the code behind each letter for the alphabet.
here is the code:
procedure TEasyForm.ABtnClick(Sender: TObject);
begin
ABtn.Enabled:= false; {When ABtn is clicked the button is disabled}
key:= 'A';
found:= false; //Check if the letter the user pressed is in the Computer Word
for count:= 1 to NumberOfLetters do
if ComputerWord[count] = key then
begin // the letter the user pressed is in the Computer Word
found:= true;
UsersWord[count]:='A';
NumberFound:= NumberFound + 1;
end;
if found // update label on form
then
begin
wordLbl.Caption:='';
for count:= 1 to length(UsersWord) do
WordLbl.Caption:=wordLbl.Caption + UsersWord[count] + ' ';
end
else
begin
NumberOfErrors:= NumberOfErrors + 1; // else increase the number of errors
Image1.Picture.LoadFromFile('imageeasy' + IntToStr (NumberOfErrors) + '.bmp');
end;
if NumberFound = NumberOfLetters // the user quessed the word
then ShowMessage('YAY! YOU WIN[IMG]http://www.delphipages.com/smilies/Exclamation.gif[/IMG]
else if NumberOfErrors = 6
then showMessage ('YOU LOSE! THE WORD WAS ' + ComputerWord);
end;