Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 05-20-2007, 08:04 PM
#578 #578 is offline
Junior Member
 
Join Date: Apr 2007
Posts: 6
Default Easy Expert Point..!

hi everyone! here is my delphi code for a hangman game, i will give the person an expert point, who ( not in over-detail) comments this program for me.

[DELPHI]
var
hangman_main: Thangman_main;
NumberOfErrors: integer;
wrong_letters: integer;
Found: boolean;
animals,countries,foods,sports: array[1..10] of string;

implementation

uses Unit3, Unit1;

{$R *.DFM}

var
hidden_word, user_word: string;
letterguessed, wlbl: string;
count: integer;


procedure Thangman_main.exitbtnClick(Sender: TObject);

begin
application.terminate
end;

procedure Thangman_main.continuebtnClick(Sender: TObject);

begin
Hangman_Main.visible:= false;
hangman_Instructions.visible:= true;


end;

procedure Thangman_main.newgamebtnClick(Sender: TObject);
begin
hangman_main.visible:= false;
hangman_welcome.visible:= true;
hangmanimage.picture.loadfromfile('gallow_0.jpg');
welcomehead2lbl.visible:=true;
combobox1.text := 'Please Select A Topic';
combobox1.visible := true;
letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
wordlbl.caption:='';

end;

procedure Thangman_main.ComboBox1Change(Sender: TObject);
var word_r, j:integer;
begin
newgamebtn.visible:=true;
wordlbl.visible:=true;
hangmanimage.visible:=true;
ComboBox1.Hide;
Welcomehead2lbl.hide;

letterbtna.show;
letterbtnb.show;
letterbtnc.show;
letterbtnd.show;
letterbtne.show;
letterbtnf.show;
letterbtng.show;
letterbtnh.show;
letterbtni.show;
letterbtnj.show;
letterbtnk.show;
letterbtnl.show;
letterbtnm.show;
letterbtnn.show;
letterbtno.show;
letterbtnp.show;
letterbtnq.show;
letterbtnr.show;
letterbtns.show;
letterbtnt.show;
letterbtnu.show;
letterbtnv.show;
letterbtnw.show;
letterbtnx.show;
letterbtny.show;
letterbtnz.show;

If combobox1.Text = 'Animals' then
begin
randomize;
word_r := random(10);
hidden_word := animals[word_r];
end;
If combobox1.Text = 'Countries' then
begin
randomize;
word_r := random(10);
hidden_word := Countries[word_r];
end;
If combobox1.Text = 'Foods' then
begin
randomize;
word_r := random(10);
hidden_word := Foods[word_r];
end;
If combobox1.Text = 'Sports' then
begin
randomize;
word_r := random(10);
hidden_word := Sports[word_r];
end;

For j := 1 to length(hidden_word) do
begin
wordlbl.caption := wordlbl.caption + '-';
user_word := hidden_word;
end;
end;








procedure Thangman_main.FormCreate(Sender: TObject);
begin

newgamebtn.visible:=false;
wordlbl.visible:=false;
hangmanimage.visible:=false;

Animals[1]:='BEAR';
Animals[2]:='EAGLE';
Animals[3]:='HORSE';
Animals[4]:='CAT';
Animals[5]:='DOG';
Animals[6]:='HAMSTER';
Animals[7]:='SHARK';
Animals[8]:='SNAKE';
Animals[9]:='LION';
Animals[10]:='GOAT';

Countries[1]:='CHINA';
Countries[2]:='TURKEY';
Countries[3]:='BRAZIL';
Countries[4]:='SUDAN';
Countries[5]:='JORDAN';
Countries[6]:='NORWAY';
Countries[7]:='IRELAND';
Countries[8]:='ITALY';
Countries[9]:='IRAQ';
Countries[10]:='BALI';

Foods[1]:='MANGO';
Foods[2]:='SANDWICH';
Foods[3]:='RICE';
Foods[4]:='CAKE';
Foods[5]:='GARLIC';
Foods[6]:='SPINACH';
Foods[7]:='PARSLEY';
Foods[8]:='PIE';
Foods[9]:='STEAK';
Foods[10]:='CHIPS';

Sports[1]:='ROWING';
Sports[2]:='HOCKEY';
Sports[3]:='KARTING';
Sports[4]:='SQUASH';
Sports[5]:='RUGBY';
Sports[6]:='BOWLING';
Sports[7]:='SURFING';
Sports[8]:='BOXING';
Sports[9]:='WRESTLING';
Sports[10]:='KENDO';


end;

procedure Thangman_main.letterbtnaClick(Sender: TObject);
begin
letterguessed:='A';
wlbl := wordlbl.Caption;
letterbtna.enabled:=false;

case pos ('A', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('A', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('A', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('A', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('A', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('A', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('A', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('A', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('A', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('A', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'A';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');
letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin
ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;


procedure Thangman_main.letterbtnbClick(Sender: TObject);
begin
letterguessed:='B';
wlbl := wordlbl.Caption;
letterbtnb.enabled:=false;

case pos ('B', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('B', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('B', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('B', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('B', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('B', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('B', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('B', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('B', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('B', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'B';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');
letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin
ShowMessage('You Win.');
letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

procedure Thangman_main.letterbtncClick(Sender: TObject);
begin
letterguessed:='C';
wlbl := wordlbl.Caption;
letterbtnc.enabled:=false;

case pos ('C', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('C', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('C', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('C', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('C', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('C', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('C', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('C', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('C', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('C', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'C';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then begin
letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;
ShowMessage('You Win.');

end;

procedure Thangman_main.letterbtndClick(Sender: TObject);
begin
letterguessed:='D';
wlbl := wordlbl.Caption;
letterbtnd.enabled:=false;

case pos ('D', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('D', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('D', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('D', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('D', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('D', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('D', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('D', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('D', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('D', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'D';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then begin
ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

procedure Thangman_main.letterbtneClick(Sender: TObject);
begin
letterguessed:='E';
wlbl := wordlbl.Caption;
letterbtne.enabled:=false;

case pos ('E', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('E', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('E', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('E', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('E', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('E', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('E', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('E', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('E', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('E', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'E';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then begin
ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;
end;

procedure Thangman_main.letterbtnfClick(Sender: TObject);
begin
letterguessed:='F';
wlbl := wordlbl.Caption;
letterbtnf.enabled:=false;

case pos ('F', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('F', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('F', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('F', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('F', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('F', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('F', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('F', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('F', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('F', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'F';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then begin
ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;
end;

procedure Thangman_main.letterbtngClick(Sender: TObject);
begin
letterguessed:='G';
wlbl := wordlbl.Caption;
letterbtng.enabled:=false;

case pos ('G', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('G', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('G', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('G', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('G', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('G', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('G', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('G', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('G', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('G', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'G';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then begin
ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnhClick(Sender: TObject);
begin
letterguessed:='H';
wlbl := wordlbl.Caption;
letterbtnh.enabled:=false;

case pos ('H', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('H', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('H', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('H', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('H', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('H', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('H', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('H', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('H', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('H', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'H';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then begin
ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtniClick(Sender: TObject);
begin
letterguessed:='I';
wlbl := wordlbl.Caption;
letterbtni.enabled:=false;

case pos ('I', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('I', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('I', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('I', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('I', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('I', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('I', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('I', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('I', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('I', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'I';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then begin
ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnjClick(Sender: TObject);
begin
letterguessed:='J';
wlbl := wordlbl.Caption;
letterbtnj.enabled:=false;

case pos ('J', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('J', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('J', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('J', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('J', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('J', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('J', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('J', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('J', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('J', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'J';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then begin
ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnkClick(Sender: TObject);
begin
letterguessed:='K';
wlbl := wordlbl.Caption;
letterbtnk.enabled:=false;

case pos ('K', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('K', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('K', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('K', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('K', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('K', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('K', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('K', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('K', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('K', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'K';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

procedure Thangman_main.letterbtnlClick(Sender: TObject);
begin
letterguessed:='L';
wlbl := wordlbl.Caption;
letterbtnl.enabled:=false;

case pos ('L', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('L', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('L', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('L', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('L', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('L', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('L', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('L', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('L', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('L', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'L';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnmClick(Sender: TObject);
begin
letterguessed:='M';
wlbl := wordlbl.Caption;
letterbtnm.enabled:=false;

case pos ('M', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('M', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('M', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('M', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('M', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('M', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('M', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('M', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('M', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('M', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'M';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnnClick(Sender: TObject);
begin
letterguessed:='N';
wlbl := wordlbl.Caption;
letterbtnn.enabled:=false;

case pos ('N', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('N', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('N', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('N', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('N', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('N', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('N', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('N', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('N', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('N', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'N';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnoClick(Sender: TObject);
begin
letterguessed:='O';
wlbl := wordlbl.Caption;
letterbtno.enabled:=false;

case pos ('O', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('O', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('O', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('O', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('O', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('O', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('O', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('O', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('O', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('O', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'O';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnpClick(Sender: TObject);
begin
letterguessed:='P';
wlbl := wordlbl.Caption;
letterbtnp.enabled:=false;

case pos ('P', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('P', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('P', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('P', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('P', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('P', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('P', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('P', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('P', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('P', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'P';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnqClick(Sender: TObject);
begin
letterguessed:='Q';
wlbl := wordlbl.Caption;
letterbtnq.enabled:=false;

case pos ('Q', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('Q', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('Q', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('Q', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('Q', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('Q', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('Q', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('Q', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('Q', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('Q', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'Q';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.'); letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnrClick(Sender: TObject);
begin
letterguessed:='R';
wlbl := wordlbl.Caption;
letterbtnr.enabled:=false;

case pos ('R', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('R', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('R', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('R', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('R', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('R', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('R', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('R', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('R', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('R', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'R';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnsClick(Sender: TObject);
begin
letterguessed:='S';
wlbl := wordlbl.Caption;
letterbtns.enabled:=false;

case pos ('S', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('S', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('S', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('S', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('S', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('S', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('S', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('S', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('S', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('S', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'S';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtntClick(Sender: TObject);
begin
letterguessed:='T';
wlbl := wordlbl.Caption;
letterbtnt.enabled:=false;

case pos ('T', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('T', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('T', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('T', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('T', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('T', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('T', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('T', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('T', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('T', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'T';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnuClick(Sender: TObject);
begin
letterguessed:='U';
wlbl := wordlbl.Caption;
letterbtnu.enabled:=false;

case pos ('U', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('U', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('U', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('U', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('U', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('U', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('U', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('U', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('U', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('U', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'U';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnvClick(Sender: TObject);
begin
letterguessed:='V';
wlbl := wordlbl.Caption;
letterbtnv.enabled:=false;

case pos ('V', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('V', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('V', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('V', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('V', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('V', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('V', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('V', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('V', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('V', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'V';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnwClick(Sender: TObject);
begin
letterguessed:='W';
wlbl := wordlbl.Caption;
letterbtnw.enabled:=false;

case pos ('W', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('W', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('W', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('W', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('W', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('W', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('W', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('W', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('W', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('W', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'W';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnxClick(Sender: TObject);
begin
letterguessed:='X';
wlbl := wordlbl.Caption;
letterbtnx.enabled:=false;

case pos ('X', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('X', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('X', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('X', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('X', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('X', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('X', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('X', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('X', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('X', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'X';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnyClick(Sender: TObject);
begin
letterguessed:='Y';
wlbl := wordlbl.Caption;
letterbtny.enabled:=false;

case pos ('Y', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('Y', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('Y', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('Y', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('Y', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('Y', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('Y', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('Y', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('Y', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('Y', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'Y';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.letterbtnzClick(Sender: TObject);
begin
letterguessed:='Z';
wlbl := wordlbl.Caption;
letterbtnz.enabled:=false;

case pos ('Z', hidden_word) of
1: begin
delete (wlbl, 1, 1);
insert ('Z', wlbl, 1);
end;
2: begin
delete (wlbl, 2, 1);
insert ('Z', wlbl, 2);
end;
3: begin
delete (wlbl, 3, 1);
insert ('Z', wlbl, 3);
end;
4: begin
delete (wlbl, 4, 1);
insert ('Z', wlbl, 4);
end;
5: begin
delete (wlbl, 5, 1);
insert ('Z', wlbl, 5);
end;
6: begin
delete (wlbl, 6, 1);
insert ('Z', wlbl, 6);
end;
7: begin
delete (wlbl, 7, 1);
insert ('Z', wlbl, 7);
end;
8: begin
delete (wlbl, 8, 1);
insert ('Z', wlbl, 8);
end;
9: begin
delete (wlbl, 9, 1);
insert ('Z', wlbl, 9);
end;


Else
wrongletterslbl.caption:=wrongletterslbl.caption + 'Z';
wrong_letters := wrong_letters + 1;
hangmanimage.picture.loadfromfile('Gallow_' + IntToStr(wrong_letters) + '.jpg');
If wrong_letters = 5 then begin
ShowMessage('Game Over.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide;
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

wordlbl.caption := wlbl;
If wordlbl.caption = hidden_word then
begin ShowMessage('You Win.');letterbtna.hide;
letterbtnb.hide;
letterbtnc.hide;
letterbtnd.hide;
letterbtne.hide;
letterbtnf.hide;
letterbtng.hide;
letterbtnh.hide;
letterbtnh.hide;
letterbtni.hide;
letterbtnj.hide;
letterbtnk.hide;
letterbtnl.hide; wordlbl.caption:=hidden_word; wrongletterslbl.caption := '';
letterbtnm.hide;
letterbtnn.hide;
letterbtno.hide;
letterbtnp.hide;
letterbtnq.hide;
letterbtnr.hide;
letterbtns.hide;
letterbtnt.hide;
letterbtnu.hide;
letterbtnv.hide;
letterbtnw.hide;
letterbtnx.hide;
letterbtny.hide;
letterbtnz.hide;
end;

end;

procedure Thangman_main.yormShow(Sender: TObject);
begin
letterbtna.Enabled := true;
letterbtnb.Enabled := true;
letterbtnc.Enabled := true;
letterbtnd.Enabled := true;
letterbtne.Enabled := true;
letterbtnf.Enabled := true;
letterbtng.Enabled := true;
letterbtnh.Enabled := true;
letterbtni.Enabled := true;
letterbtnj.Enabled := true;
letterbtnk.Enabled := true;
letterbtnl.Enabled := true;
letterbtnm.Enabled := true;
letterbtnn.Enabled := true;
letterbtno.Enabled := true;
letterbtnp.Enabled := true;
letterbtnq.Enabled := true;
letterbtnr.Enabled := true;
letterbtns.Enabled := true;
letterbtnt.Enabled := true;
letterbtnu.Enabled := true;
letterbtnv.Enabled := true;
letterbtnw.Enabled := true;
letterbtnx.Enabled := true;
letterbtny.Enabled := true;
letterbtnz.Enabled := true;
end;

end.
[/DELPHI]
Reply With Quote
  #2  
Old 05-20-2007, 09:47 PM
omni omni is offline
Senior Member
 
Join Date: Feb 2005
Posts: 194
Default RE: Easy Expert Point..!

heh, how can it be yours if you can't understand it. It's clear that you download it soemwhere or somebody made it for yourself.

If i have helped you, click ACCEPT AS ANSWER to help me get my 17th point!
Reply With Quote
  #3  
Old 05-20-2007, 10:42 PM
davidj davidj is offline
Senior Member
 
Join Date: Jan 2001
Posts: 2,900
Default RE: Easy Expert Point..!

Is there a hangman convention on I haven't heard about
Reply With Quote
  #4  
Old 05-21-2007, 12:23 AM
RickySan RickySan is offline
Senior Member
 
Join Date: Jan 2001
Posts: 140
Default RE: Easy Expert Point..!

Sure looks that way eh.. Either that or it's the same person under different usernames trying to get his/her school assignment done by someone else, either way it's annoying.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:13 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.