Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Hang Man
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
sockoo




PostPosted: Mon Jun 20, 2005 2:43 pm   Post subject: Hang Man

I Attempted at making a hang man .. not knowing really how to make one .. and i'v some what got the idea but .. its really screwed up ... and well i have no idea where to go from here .. soo if anyone could point me in the right direction or .. tell me show me how i went wrong .. it would be appriciated thanks


Hang Man.zip
 Description:

Download
 Filename:  Hang Man.zip
 Filesize:  3.82 KB
 Downloaded:  92 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
MysticVegeta




PostPosted: Mon Jun 20, 2005 6:58 pm   Post subject: (No subject)

exactly what do you need help with?
sockoo




PostPosted: Mon Jun 20, 2005 7:20 pm   Post subject: (No subject)

have you looked at it ? ..
it shows you the word at the top left soo i had a reference of what it was ..
but put a letter that either isnt or is in the word .. and it starts going crazy. if u put one that isnt in the word it fine and does what its suppose to do but if u put one that is .. it says it isnt but yet it is .. also .. the appearence of the word after they've guess it is also out of whack .. try running it and playing it u'll come across whats wrong ..
sockoo




PostPosted: Tue Jun 21, 2005 3:48 pm   Post subject: (No subject)

Here's the code for anyone who is to lazy to dl it .. but u'll need the images and word file .. soo i'd sugest dl it or .. make ur own i suppose

code:

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


The bolded part is where everything messes up ..
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: