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

Username:   Password: 
 RegisterRegister   
 [source] My Hangman Game version 1.1v... (button updates)
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
we64




PostPosted: Mon Jan 26, 2004 2:26 pm   Post subject: [source] My Hangman Game version 1.1v... (button updates)

I updated all of my buttons, so it shows select and release...

code:

%Hangman Game 1.1 v.
%By Tony Zhang
setscreen ("graphics:1000;650")
var x, y, letter : int := 0
var colo : int
var fx, sx, tx : array 1 .. 11 of int := init (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
var words : array 1 .. 15 of string := init ("computer", "baseball", "program", "video", "cat", "dog", "tiger", "driver", "soccer", "radio", "music", "science", "king", "basketball", "chess")
var random, counter, right : int := 0
var word, choice, let : string := ""

process won
    loop
        Draw.Text ("YaY, You won!", maxx div 2 - 100, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (1, 100))
        delay (500)
        exit when choice = "y" or choice = "n"
    end loop
end won

process lost
    loop
        Draw.Text ("You Lost!", maxx div 2 - 50, maxy div 2 - 50, Font.New ("serif:24:bold"), Rand.Int (155, 200))
        Draw.Text ("The word was:", maxx div 2 - 150, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (155, 200))
        Draw.Text (words (random), maxx div 2 + 60, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (155, 200))
        delay (500)
        exit when choice = "y" or choice = "n"
    end loop
end lost

proc playagain
    loop
        if Mouse.ButtonMoved ("down") then
            var buttonnumber, buttonupdown : int
            Mouse.ButtonWait ("down", x, y, buttonnumber, buttonupdown)
            if x >= maxx div 2 - 95 and x <= maxx div 2 - 5 and y >= maxy - 245 and y <= maxy - 205 then
                choice := "y"
                drawfillbox (maxx div 2 - 95, maxy - 245, maxx div 2 - 5, maxy - 205, black)
                drawfillbox (maxx div 2 - 94, maxy - 245, maxx div 2 - 5, maxy - 206, 29)
                Draw.Text ("Yes", maxx div 2 - 75, maxy - 235, Font.New ("serif:24:bold"), black)
                delay (300)
            elsif x >= maxx div 2 + 5 and x <= maxx div 2 + 95 and y >= maxy - 245 and y <= maxy - 205 then
                choice := "n"
                drawfillbox (maxx div 2 + 95, maxy - 245, maxx div 2 + 5, maxy - 205, black)
                drawfillbox (maxx div 2 + 96, maxy - 245, maxx div 2 + 5, maxy - 206, 29)
                Draw.Text ("No", maxx div 2 + 30, maxy - 235, Font.New ("serif:24:bold"), black)
                delay (300)
            end if
        end if
        exit when choice = "y" or choice = "n"
    end loop
end playagain

loop
    %Background
    randint (colo, 75, 79)
    colourback (colo)
    cls

    %Title
    Draw.Text ("Welcome to Tony's Hangman Game", maxx div 2 - 150, maxy - 20, Font.New ("serif:16:bold"), 40)

    %Question
    locate (3, 1)
    put "Please choose letters from the alphabets"

    %Hang
    drawfillbox (640, 170, 660, 410, 112)     %post
    drawfillbox (660, 390, 760, 410, 112)
    drawfillbox (600, 160, 800, 180, 115)     %ground
    drawfillbox (730, 390, 740, 358, 114)     %wire
    drawarc (735, 345, 13, 13, 0, 360, 114)

    %Random Words and Dashes
    randint (random, 1, 15)
    var dash : array 1 .. length (words (random)) of string
    for a : 1 .. length (words (random))
        dash (a) := "_"
    end for

    %Alphabets
    var used : array 1 .. 26 of string
    var letters : array 1 .. 26 of string
    for a : 1 .. 26
        used (a) := chr (96 + a)
        letters (a) := chr (96 + a)
    end for

    %Out put
    loop
        %Draw Dash
        locate (8, 15)
        for a : 1 .. length (words (random))
            put dash (a) : 3, " " ..
        end for

        %Keyboard

        for a : 1 .. 10
            %First Row
            drawfillbox (90 + fx (a), 250, 140 + fx (a), 300, 29)
            drawfillbox (95 + fx (a), 255, 135 + fx (a), 295, 26)
            drawbox (90 + fx (a), 250, 140 + fx (a), 300, white)
            Draw.Text (letters (a), 110 + fx (a), 270, Font.New ("serif:22:bold"), 35)
            fx (a + 1) := a * 50

            %Second Row
            drawfillbox (90 + sx (a), 200, 140 + sx (a), 250, 29)
            drawfillbox (95 + sx (a), 205, 135 + sx (a), 245, 26)
            drawbox (90 + sx (a), 200, 140 + sx (a), 250, white)
            Draw.Text (letters (a + 10), 110 + sx (a), 220, Font.New ("serif:22:bold"), 35)
            sx (a + 1) := a * 50

            %Third Row
            tx (a + 1) := a * 50
            if tx (a) >= 100 and tx (a) <= 350 then
                drawfillbox (90 + tx (a), 150, 140 + tx (a), 200, 29)
                drawfillbox (95 + tx (a), 155, 135 + tx (a), 195, 26)
                drawbox (90 + tx (a), 150, 140 + tx (a), 200, white)
                Draw.Text (letters (a + 18), 110 + tx (a), 170, Font.New ("serif:22:bold"), 35)
            end if
        end for

        %Click
        loop
            if Mouse.ButtonMoved ("down") then
                var buttonnumber, buttonupdown : int
                Mouse.ButtonWait ("down", x, y, buttonnumber, buttonupdown)
                if x >= 95 and x <= 135 and y >= 255 and y <= 295 then
                    let := "a"
                elsif x >= 145 and x <= 185 and y >= 255 and y <= 295 then
                    let := "b"
                elsif x >= 195 and x <= 235 and y >= 255 and y <= 295 then
                    let := "c"
                elsif x >= 245 and x <= 285 and y >= 255 and y <= 295 then
                    let := "d"
                elsif x >= 295 and x <= 335 and y >= 255 and y <= 295 then
                    let := "e"
                elsif x >= 345 and x <= 385 and y >= 255 and y <= 295 then
                    let := "f"
                elsif x >= 395 and x <= 435 and y >= 255 and y <= 295 then
                    let := "g"
                elsif x >= 445 and x <= 485 and y >= 255 and y <= 295 then
                    let := "h"
                elsif x >= 495 and x <= 535 and y >= 255 and y <= 295 then
                    let := "i"
                elsif x >= 545 and x <= 585 and y >= 255 and y <= 295 then
                    let := "j"
                elsif x >= 95 and x <= 135 and y >= 205 and y <= 245 then
                    let := "k"
                elsif x >= 145 and x <= 185 and y >= 205 and y <= 245 then
                    let := "l"
                elsif x >= 195 and x <= 235 and y >= 205 and y <= 245 then
                    let := "m"
                elsif x >= 245 and x <= 285 and y >= 205 and y <= 245 then
                    let := "n"
                elsif x >= 295 and x <= 335 and y >= 205 and y <= 245 then
                    let := "o"
                elsif x >= 345 and x <= 385 and y >= 205 and y <= 245 then
                    let := "p"
                elsif x >= 395 and x <= 435 and y >= 205 and y <= 245 then
                    let := "q"
                elsif x >= 445 and x <= 485 and y >= 205 and y <= 245 then
                    let := "r"
                elsif x >= 495 and x <= 535 and y >= 205 and y <= 245 then
                    let := "s"
                elsif x >= 545 and x <= 585 and y >= 205 and y <= 245 then
                    let := "t"
                elsif x >= 195 and x <= 235 and y >= 155 and y <= 195 then
                    let := "u"
                elsif x >= 245 and x <= 285 and y >= 155 and y <= 195 then
                    let := "v"
                elsif x >= 295 and x <= 335 and y >= 155 and y <= 195 then
                    let := "w"
                elsif x >= 345 and x <= 385 and y >= 155 and y <= 195 then
                    let := "x"
                elsif x >= 395 and x <= 435 and y >= 155 and y <= 195 then
                    let := "y"
                elsif x >= 445 and x <= 485 and y >= 155 and y <= 195 then
                    let := "z"
                else
                    let := " "
                end if

                %Select
                if ord (let) >= 97 and ord (let) <= 106 then
                    drawfillbox (95 + fx (ord (let) - 96), 255, 135 + fx (ord (let) - 96), 295, black)
                    drawfillbox (96 + fx (ord (let) - 96), 253, 135 + fx (ord (let) - 96), 294, 29)
                    Draw.Text (let, 110 + fx (ord (let) - 96), 270, Font.New ("serif:22:bold"), 35)
                elsif ord (let) >= 107 and ord (let) <= 116 then
                    drawfillbox (95 + sx (ord (let) - 106), 205, 135 + sx (ord (let) - 106), 245, black)
                    drawfillbox (96 + sx (ord (let) - 106), 203, 135 + sx (ord (let) - 106), 244, 29)
                    Draw.Text (let, 110 + sx (ord (let) - 106), 220, Font.New ("serif:22:bold"), 35)
                elsif ord (let) >= 117 and ord (let) <= 122 then
                    drawfillbox (95 + tx (ord (let) - 116 + 2), 155, 135 + tx (ord (let) - 116 + 2), 195, black)
                    drawfillbox (96 + tx (ord (let) - 116 + 2), 153, 135 + tx (ord (let) - 116 + 2), 194, 29)
                    Draw.Text (let, 110 + tx (ord (let) - 116 + 2), 170, Font.New ("serif:22:bold"), 35)
                end if

                delay (300)
                exit when ord (let) > 96
            end if
        end loop

        %Release
        if ord (let) >= 97 and ord (let) <= 106 then
            drawfillbox (90 + fx (ord (let) - 96), 250, 140 + fx (ord (let) - 96), 300, 29)
            drawfillbox (95 + fx (ord (let) - 96), 255, 135 + fx (ord (let) - 96), 295, 26)
            drawbox (90 + fx (ord (let) - 96), 250, 140 + fx (ord (let) - 96), 300, white)
            Draw.Text (let, 110 + fx (ord (let) - 96), 270, Font.New ("serif:22:bold"), 35)
        elsif ord (let) >= 107 and ord (let) <= 116 then
            drawfillbox (90 + sx (ord (let) - 106), 200, 140 + sx (ord (let) - 106), 250, 29)
            drawfillbox (95 + sx (ord (let) - 106), 205, 135 + sx (ord (let) - 106), 245, 26)
            drawbox (90 + sx (ord (let) - 106), 200, 140 + sx (ord (let) - 106), 250, white)
            Draw.Text (let, 110 + sx (ord (let) - 106), 220, Font.New ("serif:22:bold"), 35)
        elsif ord (let) >= 117 and ord (let) <= 122 then
            drawfillbox (90 + tx (ord (let) - 116 + 2), 150, 140 + tx (ord (let) - 116 + 2), 200, 29)
            drawfillbox (95 + tx (ord (let) - 116 + 2), 155, 135 + tx (ord (let) - 116 + 2), 195, 26)
            drawbox (90 + tx (ord (let) - 116 + 2), 150, 140 + tx (ord (let) - 116 + 2), 200, white)
            Draw.Text (let, 110 + tx (ord (let) - 116 + 2), 170, Font.New ("serif:22:bold"), 35)
        end if

        %Used Letter
        for a : 1 .. 26
            if let = used (a) and letters (a) not= chr (42) then
                locate (5, 1)
                put ""
                letters (a) := chr (42)
                %Wrong Letter
                if index (words (random), let) = 0 then
                    counter += 1
                end if
            elsif let = used (a) and letters (a) = chr (42) then
                locate (5, 1)
                put "You have already used this letter, please choose another one!!"
            end if
        end for

        %Hangman face
        if counter = 1 then
            drawfilloval (735, 355, 15, 15, 89)
        elsif counter = 2 then
            drawfilloval (728, 357, 3, 3, black)         % left eye
        elsif counter = 3 then
            drawfilloval (742, 357, 3, 3, black)         %right eye
        elsif counter = 4 then
            drawarc (735, 345, 5, 5, 20, 160, black)         %mouth
            %Hangman body
        elsif counter = 5 then
            drawline (735, 340, 735, 280, black)
            Draw.Text ("Help me please!", 795, 330, Font.New ("serif:16:bold"), 40)
        elsif counter = 6 then
            drawline (735, 310, 765, 340, black)         %right arm
            Draw.Text ("Help me please!", 795, 330, Font.New ("serif:16:bold"), colo)
            Draw.Text ("Help me!", 795, 330, Font.New ("serif:16:bold"), 40)
        elsif counter = 7 then
            drawline (735, 310, 705, 340, black)         %left arm
        elsif counter = 8 then
            drawline (735, 280, 765, 250, black)         %right leg
            Draw.Text ("Help me!", 795, 330, Font.New ("serif:16:bold"), colo)
            Draw.Text ("Help! Help!", 795, 330, Font.New ("serif:16:bold"), 40)
        elsif counter = 9 then
            drawline (735, 280, 705, 250, black)         %left leg
        end if

        %Right letter
        for a : 1 .. length (words (random))
            if let = words (random) (a) then
                dash (a) := let
            end if
        end for

        %Draw Dashes
        locate (8, 15)
        for a : 1 .. length (words (random))
            put dash (a) : 3, " " ..
        end for

        %Right word checking
        for a : 1 .. length (words (random))
            right += index (dash (a), "_")
        end for

        %Exits
        letter := 0
        exit when right = 0
        right := 0
        exit when counter = 9
    end loop

    %Play again
    delay (1000)
    cls
    Draw.Text ("Would you like to play again?", maxx div 2 - 130, maxy - 100, Font.New ("serif:16:bold"), 56)

    %Yes
    drawfillbox (maxx div 2 - 100, maxy - 250, maxx div 2, maxy - 200, 29)
    drawfillbox (maxx div 2 - 95, maxy - 245, maxx div 2 - 5, maxy - 205, 26)
    drawbox (maxx div 2 - 100, maxy - 250, maxx div 2, maxy - 200, white)
    Draw.Text ("Yes", maxx div 2 - 75, maxy - 235, Font.New ("serif:24:bold"), black)

    %No
    drawfillbox (maxx div 2 + 100, maxy - 250, maxx div 2, maxy - 200, 29)
    drawfillbox (maxx div 2 + 95, maxy - 245, maxx div 2 + 5, maxy - 205, 26)
    drawbox (maxx div 2 + 100, maxy - 250, maxx div 2, maxy - 200, white)
    Draw.Text ("No", maxx div 2 + 30, maxy - 235, Font.New ("serif:24:bold"), black)

    %Choice to Play Again
    choice := ""
    if counter = 9 then
        fork lost
        playagain
    elsif word = words (random) or right = 0 then
        fork won
        playagain
    end if

    exit when choice = "n"
    counter := 0
    cls
end loop
Sponsor
Sponsor
Sponsor
sponsor
sport




PostPosted: Mon Jan 26, 2004 6:01 pm   Post subject: (No subject)

It doen't work. Twisted Evil
code:

Draw.Text (letters (a + 1, 110 + nx, 170, Font.New ("serif:22:bold"), 56)
            end if

Too many subscripts for letter
shorthair




PostPosted: Mon Jan 26, 2004 6:45 pm   Post subject: (No subject)

IM not a fan of it , but it looks like you put some good effort into it , IM NOW GIVING RATINGS , il give you a 6/10 , keep on improving it , and updating it , i love seeing updates , it shows what you have learned and how advanced people are getting
we64




PostPosted: Mon Jan 26, 2004 8:08 pm   Post subject: (No subject)

I will fix it
we64




PostPosted: Mon Jan 26, 2004 8:30 pm   Post subject: (No subject)

Sorry about it did not work, it was because that I didn't put it in code (I can't post if I put it in code, I don't know why). It is for my school project and I learned the mouse commands by myself during this exam week, I am not sure if it is the right way of using it. Well, anyway, this the best I can do with my knowledge...

code:
%Text Select
%By Tony Zhang
setscreen ("graphics:1000;650")
var x, y, nx, button, letter : int := 0
var colo : int
var words : array 1 .. 15 of string := init ("computer", "baseball", "program", "video", "cat", "dog", "tiger", "driver", "soccer", "radio", "music", "science", "king", "basketball", "chess")
var random, counter, right : int := 0
var word, choice, let : string := ""

process won
    loop
        Draw.Text ("YaY, You won!", maxx div 2 - 100, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (1, 100))
        delay (500)
        exit when choice = "y" or choice = "n"
    end loop
end won

process lost
    loop
        Draw.Text ("You Lost!", maxx div 2 - 50, maxy div 2 - 50, Font.New ("serif:24:bold"), Rand.Int (155, 200))
        Draw.Text ("The word was:", maxx div 2 - 150, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (155, 200))
        Draw.Text (words (random), maxx div 2 + 60, maxy div 2, Font.New ("serif:24:bold"), Rand.Int (155, 200))
        delay (500)
        exit when choice = "y" or choice = "n"
    end loop
end lost

proc playagain
    loop
        if Mouse.ButtonMoved ("down") then
            var buttonnumber, buttonupdown : int
            Mouse.ButtonWait ("down", x, y, buttonnumber, buttonupdown)
            if x >= maxx div 2 - 95 and x <= maxx div 2 - 5 and y >= maxy - 245 and y <= maxy - 205 then
                choice := "y"
            elsif x >= maxx div 2 + 5 and x <= maxx div 2 + 95 and y >= maxy - 245 and y <= maxy - 205 then
                choice := "n"
            end if
        end if
        exit when choice = "y" or choice = "n"
    end loop
end playagain

loop
    %Background
    randint (colo, 75, 79)
    colourback (colo)
    cls

    %Title
    Draw.Text ("Welcome to Tony's Hangman Game", maxx div 2 - 150, maxy - 20, Font.New ("serif:16:bold"), 40)

    %Question
    locate (3, 1)
    put "Please choose letters from the alphabets"

    %Hang

    drawfillbox (640, 170, 660, 410, 112)     %post
    drawfillbox (660, 390, 760, 410, 112)
    drawfillbox (600, 160, 800, 180, 115)     %ground
    drawfillbox (730, 390, 740, 358, 114)     %wire
    drawarc (735, 345, 13, 13, 0, 360, 114)

    %Random Words and Dashes
    randint (random, 1, 15)
    var dash : array 1 .. length (words (random)) of string
    for a : 1 .. length (words (random))
        dash (a) := "_"
    end for

    %Alphabets
    var used : array 1 .. 26 of string
    var letters : array 1 .. 26 of string
    for a : 1 .. 26
        used (a) := chr (96 + a)
        letters (a) := chr (96 + a)
    end for

    %Out put
    loop
        %Draw Dash
        locate (8, 15)
        for a : 1 .. length (words (random))
            put dash (a) : 3, " " ..
        end for

        %Keyboard
        for a : 1 .. 10
            %First Row
            drawbox (90 + nx, 250, 140 + nx, 300, black)
            drawfillbox (95 + nx, 255, 135 + nx, 295, grey)
            Draw.Text (letters (a), 110 + nx, 270, Font.New ("serif:22:bold"), 56)

            %Second Row
            drawbox (90 + nx, 200, 140 + nx, 250, black)
            drawfillbox (95 + nx, 205, 135 + nx, 245, grey)
            Draw.Text (letters (a + 10), 110 + nx, 220, Font.New ("serif:22:bold"), 56)

            %Third Row
            if nx >= 100 and nx <= 350 then
                drawbox (90 + nx, 150, 140 + nx, 200, black)
                drawfillbox (95 + nx, 155, 135 + nx, 195, grey)
                Draw.Text (letters (a + 18), 110 + nx, 170, Font.New ("serif:22:bold"), 56)
            end if
            nx += 50
        end for

        %Click
        loop
            if Mouse.ButtonMoved ("down") then
                var buttonnumber, buttonupdown : int
                Mouse.ButtonWait ("down", x, y, buttonnumber, buttonupdown)
                if x >= 95 and x <= 135 and y >= 255 and y <= 295 then
                    let := "a"
                elsif x >= 145 and x <= 185 and y >= 255 and y <= 295 then
                    let := "b"
                elsif x >= 195 and x <= 235 and y >= 255 and y <= 295 then
                    let := "c"
                elsif x >= 245 and x <= 285 and y >= 255 and y <= 295 then
                    let := "d"
                elsif x >= 295 and x <= 335 and y >= 255 and y <= 295 then
                    let := "e"
                elsif x >= 345 and x <= 385 and y >= 255 and y <= 295 then
                    let := "f"
                elsif x >= 395 and x <= 435 and y >= 255 and y <= 295 then
                    let := "g"
                elsif x >= 445 and x <= 485 and y >= 255 and y <= 295 then
                    let := "h"
                elsif x >= 495 and x <= 535 and y >= 255 and y <= 295 then
                    let := "i"
                elsif x >= 545 and x <= 585 and y >= 255 and y <= 295 then
                    let := "j"
                elsif x >= 95 and x <= 135 and y >= 205 and y <= 245 then
                    let := "k"
                elsif x >= 145 and x <= 185 and y >= 205 and y <= 245 then
                    let := "l"
                elsif x >= 195 and x <= 235 and y >= 205 and y <= 245 then
                    let := "m"
                elsif x >= 245 and x <= 285 and y >= 205 and y <= 245 then
                    let := "n"
                elsif x >= 295 and x <= 335 and y >= 205 and y <= 245 then
                    let := "o"
                elsif x >= 345 and x <= 385 and y >= 205 and y <= 245 then
                    let := "p"
                elsif x >= 395 and x <= 435 and y >= 205 and y <= 245 then
                    let := "q"
                elsif x >= 445 and x <= 485 and y >= 205 and y <= 245 then
                    let := "r"
                elsif x >= 495 and x <= 535 and y >= 205 and y <= 245 then
                    let := "s"
                elsif x >= 545 and x <= 585 and y >= 205 and y <= 245 then
                    let := "t"
                elsif x >= 195 and x <= 235 and y >= 155 and y <= 195 then
                    let := "u"
                elsif x >= 245 and x <= 285 and y >= 155 and y <= 195 then
                    let := "v"
                elsif x >= 295 and x <= 335 and y >= 155 and y <= 195 then
                    let := "w"
                elsif x >= 345 and x <= 385 and y >= 155 and y <= 195 then
                    let := "x"
                elsif x >= 395 and x <= 435 and y >= 155 and y <= 195 then
                    let := "y"
                elsif x >= 445 and x <= 485 and y >= 155 and y <= 195 then
                    let := "z"
                end if
                exit when ord (let) > 96
            end if
        end loop

        %Used Letter
        for a : 1 .. 26
            if let = used (a) and letters (a) not= chr (42) then
                locate (5, 1)
                put ""
                letters (a) := chr (42)
                %Wrong Letter
                if index (words (random), let) = 0 then
                    counter += 1
                end if
            elsif let = used (a) and letters (a) = chr (42) then
                locate (5, 1)
                put "You have already used this letter, please choose another one!!"
            end if
        end for

        %Hangman face
        if counter = 1 then
            drawfilloval (735, 355, 15, 15, 89)
        elsif counter = 2 then
            drawfilloval (728, 357, 3, 3, black)         % left eye
        elsif counter = 3 then
            drawfilloval (742, 357, 3, 3, black)         %right eye
        elsif counter = 4 then
            drawarc (735, 345, 5, 5, 20, 160, black)         %mouth
            %Hangman body
        elsif counter = 5 then
            drawline (735, 340, 735, 280, black)
            Draw.Text ("Help me please!", 795, 330, Font.New ("serif:16:bold"), 40)
        elsif counter = 6 then
            drawline (735, 310, 765, 340, black)         %right arm
            Draw.Text ("Help me please!", 795, 330, Font.New ("serif:16:bold"), colo)
            Draw.Text ("Help me!", 795, 330, Font.New ("serif:16:bold"), 40)
        elsif counter = 7 then
            drawline (735, 310, 705, 340, black)         %left arm
        elsif counter = 8 then
            drawline (735, 280, 765, 250, black)         %right leg
            Draw.Text ("Help me!", 795, 330, Font.New ("serif:16:bold"), colo)
            Draw.Text ("Help! Help!", 795, 330, Font.New ("serif:16:bold"), 40)
        elsif counter = 9 then
            drawline (735, 280, 705, 250, black)         %left leg
        end if

        %Right letter
        for a : 1 .. length (words (random))
            if let = words (random) (a) then
                dash (a) := let
            end if
        end for

        %Draw Dashes
        locate (8, 15)
        for a : 1 .. length (words (random))
            put dash (a) : 3, " " ..
        end for

        %Right word checking
        for a : 1 .. length (words (random))
            right += index (dash (a), "_")
        end for

        %Exits
        letter := 0
        nx := 0
        exit when right = 0
        right := 0
        exit when counter = 9
    end loop

    %Play again
    delay (1000)
    cls
    Draw.Text ("Would you like to play again?", maxx div 2 - 130, maxy - 100, Font.New ("serif:16:bold"), 56)
    drawbox (maxx div 2 - 100, maxy - 250, maxx div 2, maxy - 200, black)
    drawfillbox (maxx div 2 - 95, maxy - 245, maxx div 2 - 5, maxy - 205, grey)
    Draw.Text ("Yes", maxx div 2 - 75, maxy - 235, Font.New ("serif:24:bold"), black)
    drawbox (maxx div 2 + 100, maxy - 250, maxx div 2, maxy - 200, black)
    drawfillbox (maxx div 2 + 95, maxy - 245, maxx div 2 + 5, maxy - 205, grey)
    Draw.Text ("No", maxx div 2 + 30, maxy - 235, Font.New ("serif:24:bold"), black)

    %Choice to Play Again
    choice := ""
    if counter = 9 then
        fork lost
        playagain
    elsif word = words (random) or right = 0 then
        fork won
        playagain
    end if

    exit when choice = "n"
    counter := 0
    cls
end loop
we64




PostPosted: Mon Jan 26, 2004 8:33 pm   Post subject: (No subject)

What the hack, I think there are some problems in the forum. It showed me an error when I tried to post with code function, but it posted... just weired... anyway, use the last one that I posted just in case...
jonos




PostPosted: Mon Jan 26, 2004 8:44 pm   Post subject: (No subject)

that's cool, the keyboard and the comments are cool.
sport




PostPosted: Mon Jan 26, 2004 9:45 pm   Post subject: (No subject)

Great program, just make thw screen a bit smaller, it is too large
shorthair




PostPosted: Tue Jan 27, 2004 6:09 am   Post subject: (No subject)

okay ,the first one you posted i had to change to work , but this one is muc hbettre you mark gets raised to a 7.5/10
AsianSensation




PostPosted: Tue Jan 27, 2004 10:59 am   Post subject: (No subject)

we64 wrote:
What the hack, I think there are some problems in the forum. It showed me an error when I tried to post with code function, but it posted... just weired... anyway, use the last one that I posted just in case...


yeah, i fixed the tag issues (who said I don't do enough work? cough cough dodge cough cough)
we64




PostPosted: Tue Jan 27, 2004 9:38 pm   Post subject: (No subject)

Thanks for fixing the error
Paul




PostPosted: Tue Jan 27, 2004 10:52 pm   Post subject: (No subject)

dude, that avatar is crazy, looks like he's been hit downlow
we64




PostPosted: Tue Jan 27, 2004 11:16 pm   Post subject: (No subject)

Very Happy Oh yeah that is crazy DIRK NOWITZKI Very Happy
we64




PostPosted: Wed Feb 04, 2004 6:28 pm   Post subject: (No subject)

I updated my buttons, so you guys can take a look and give me some suggestions... Very Happy
Paul




PostPosted: Wed Feb 04, 2004 6:32 pm   Post subject: (No subject)

The button releases even without me releasing the mouse button, but I like how the right mouse button works too, ( or is that always the case?) I tested that out, and it turns out Turing mouse stuff doesnt care if its right or left mouse button. good job.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: