var Startfont := Font.New ("Bookman Old Style:20:bold")
var Continue := Font.New ("Bookman Old Style:10")
var ch : string (1)
var word : array 1 .. 39 of string
var a, w, sn, location : int
var z : int
var word1, guess : string
forward proc question
forward proc terrance
proc greetings % First Screen , Menu
Font.Draw ("Hang Terrance", 140, maxy div 2, Startfont, blue)
Font.Draw ("Press Any Key To Continue", 10, 10, Continue, red)
getch (ch)
end greetings
proc hangstage
cls
drawline (200, 350, 200, 160, red)
drawline (150, 160, 250, 160, red)
drawline (200, 350, 300, 350, red)
drawline (300, 305, 300, 350, red)
question
end hangstage
proc lengths
locate (21, 1)
for r : 1 .. length (word (z))
put "_ " ..
end for
end lengths
[b]
body proc question
randint (z, 1, 39)
put word (z)
locate (25, 20)
lengths
%put "The Word Is", " ", length (word (z)), " Charcacters Long"
locate (23, 1)
for g : 1 .. length (word (z)) + 5
get guess
word1 := word (z)
for i : 1 .. length (word1)
if word1 (i) = guess then
location:= (i)
%put location
% put "Yes That Is In The Word"
locate (20, i)
put guess, " "
end if
end for
% if word1 (i) not= guess then
% locate (22, 1)
% put "No That Is Not In The Word" ..
% terrance
% var t := 1
% locate (t, 30)
% put guess, " "
% t += 1
% end if
%end for
lengths
end for
cls
put "sorry you are out of guesses"
put "The Word Was", " ", word (z)
end question
[/b]
body proc terrance
Pic.ScreenLoad ("Ts.JPG", 280, 240, picCopy)
end terrance
proc open1 %Opens Data
open : sn, "words.t", get
assert sn > 0
end open1
proc get1 %Gets date from file
a := 0 % Counter for array
w := 1 % Counter to count # of array's
loop
w += 1 % add's 1 to counter
a += 1 % add's 1 to counter
get : sn, word (a) %gets data
get : sn, skip
exit when eof (sn) % exits when end of file
end loop
close (sn) % closes stream number
end get1
open1
get1
greetings
hangstage
|