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

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




PostPosted: Wed Apr 09, 2014 10:26 pm   Post subject: Maze game

What is it you are trying to achieve?
I need to make it so all my Procedures can be called when they are needed


What is the problem you are having?
Procedures are not calling


Describe what you have tried to solve this problem
i have tried putting the procedures before and after they are called


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


%Cross Roads
%Bryce MacLean
%ICS3U Mr. Saxberg
%March 23 2014

%Variable Library
var Starting : string
var Entry : string
var Key : int := 0

%Procedures
proc SquareEndGate ()
    if Key = 1 then
        put "You win the game! congratulations and thanks for playing!"
    else
        put "You do not have the key! go back through the maze to find it!"
        delay (3000)
        SquareFourtyTwo ()
    end if
end SquareEndGate

proc SquareFourtyTwo ()
    loop
        put "You have a path to the South, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareEndGate ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareFourtyOne ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareFourtyTwo

proc SquareFourtyOne ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareFourtyTwo ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareFourty ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareFourtyOne

proc SquareFourty ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareFourtyOne ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareThirtyNine ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareFourty

proc SquareThirtyNine ()
    loop
        put "You have a path to the North, and East."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareThirtyEight ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareFourty ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls
        end if
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
    end loop
end SquareThirtyNine

proc SquareThirtyEight ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareThirtySeven ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareThirtyNine ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareThirtyEight

proc SquareThirtySeven ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareThirtySix ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareThirtyEight ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareThirtySeven

proc SquareThirtySix ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareThirtyFour ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareThirtySeven ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareThirtySix

proc SquareThirtyFive ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareThirtyFour ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareThirtySix ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareThirtyFive

proc SquareThirtyFour ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareThirtyThree ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareThirtyFive ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareThirtyFour

proc SquareThirtyThree ()
    loop
        put "You have a path to the East, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareThirtyFour ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareThirtyTwo ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareThirtyThree

proc SquareThirtyTwo ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareThirtyOne ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareThirtyThree ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareThirtyTwo

proc SquareThirtyOne ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareThirty ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareThirtyTwo ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareThirtyOne

proc SquareThirty ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareTwentyNine ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareThirtyOne ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareThirty

proc SquareTwentyNine ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareSix ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareThirty ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareTwentyNine

proc SquareKey ()
    loop
        Key := 1
        put "You have collected a KEY! you have a path to the West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareTwentyFour ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
    end loop
end SquareKey

proc SquareTwentySeven ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareKey ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareTwentySix ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareTwentySeven

proc SquareTwentySix ()
    loop
        put "You have a path to the North, and East."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareTwentyFive ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareTwentySeven ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls
        end if
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
    end loop
end SquareTwentySix

proc SquareTwentyFive ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareTwentyFour ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareTwentySix ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareTwentyFive

proc SquareTwentyFour ()
    loop
        put "You have a path to the East, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareTwentyFive ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls
            SquareTwentyThree ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
        end if
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareTwentyFour

proc SquareTwentyThree ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareTwentyTwo ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareTwentyFour ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareTwentyThree

proc SquareTwentyTwo ()
    loop
        put "You now see a path to the North and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareTwentyOne ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareTwentyThree ()

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
    end loop
end SquareTwentyTwo

proc SquareTwentyOne ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareTwenty ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareTwentyTwo ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareTwentyOne

proc SquareTwenty ()
    loop
        put "You now see a path to the South, North and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareNineteen ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareTwentyOne ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareFourteen ()

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareTwenty

proc SquareNineteen ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareEighteen ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareTwenty ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareNineteen

proc SquareEighteen ()
    loop
        put "You have a path to the South, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareNineteen ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareSeventeen ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareEighteen

proc SquareSeventeen ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareEighteen ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareSixteen ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareSeventeen

proc SquareSixteen ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareSeventeen ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareFifteen ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareSixteen

proc SquareFifteen ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareSixteen ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareSix ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareFifteen

proc SquareFourteen ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareTwenty ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareThirteen ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareFourteen

proc SquareThirteen ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareFourteen ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareTwelve ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareThirteen

proc SquareTwelve ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareThirteen ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareFour ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareTwelve

proc SquareEleven ()
    loop
        put "You have a path to the South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareTen ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareEleven

proc SquareTen ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareEleven ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareNine ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareTen

proc SquareNine ()
    loop
        put "You have a path to the North, and East."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareTen ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareEight ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls
        end if
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
    end loop
end SquareNine

proc SquareEight ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareSeven ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareNine ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareEight

proc SquareSeven ()
    loop
        put "You have a path to the East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareTwo ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareEight ()
        end if
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareSeven

proc SquareSix ()
    loop
        put "You have a path to the South, East, and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (3000)
            cls

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareFive ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk East one square."
            delay (2000)
            cls
            SquareFifteen ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareTwentyNine ()

        end if
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareSix

proc SquareFive ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareSix ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareFour ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareFive

proc SquareFour ()
    loop
        put "You have a path to the North, South, and East."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareFive ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareThree ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you walk east one square"
            delay (2000)
            cls
            SquareTwelve ()

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
        exit when Entry = "east" or Entry = "East" or Entry = "EAST"
    end loop
end SquareFour

proc SquareThree ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareFour ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareTwo ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareThree

proc SquareTwo ()
    loop
        put "You now see a path to the South, North and West."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareThree ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareOne ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you walk West one square."
            delay (2000)
            cls
            SquareSeven ()

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "west" or Entry = "West" or Entry = "WEST"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareTwo

proc SquareOne ()
    loop
        put "You have a path to the North, and South."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareTwo ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you walk South one square."
            delay (2000)
            cls
            SquareStart ()

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
        exit when Entry = "south" or Entry = "South" or Entry = "SOUTH"
    end loop
end SquareOne
proc SquareStart ()
    loop
        put "You have a path to the North."
        get Entry


        if Entry = "north" or Entry = "North" or Entry = "NORTH" then
            cls
            put "you walk North one square."
            delay (3000)
            cls
            SquareOne ()

        elsif Entry = "south" or Entry = "South" or Entry = "SOUTH" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "east" or Entry = "East" or Entry = "EAST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        elsif Entry = "west" or Entry = "West" or Entry = "WEST" then
            cls
            put "you cannot go that way, there is a wall."
            delay (2000)
            cls

        end if
        exit when Entry = "north" or Entry = "North" or Entry = "NORTH"
    end loop
end SquareStart


%Starp of code
put "Welcome to Cross Roads. In this game you will have to find the key hidden somewhere in a maze, and find the gate to unlock! dont get lost now!"
put " "
put "Use North, South, East and West to navigate through out the maze."
put " "
put " "

put "Type 'start' when you are ready to begin."
get Starting

if Starting = "start" then
    cls
end if

put "You enter the maze and the maze wall closes behind you."
put " "
SquareStart ()



Please specify what version of Turing you are using
Turing 4.1.1
Sponsor
Sponsor
Sponsor
sponsor
Raknarg




PostPosted: Thu Apr 10, 2014 12:17 am   Post subject: RE:Maze game

Typically procedures need to be declared before they are used in Turing. Look up forward and body in the documentation. forward procedure procName tells the program that youhaven't declared it yet, but there will be a procedure named procName declared in the future. body procedure procName is where you actually write the procedure.
FenRackety




PostPosted: Thu Apr 10, 2014 2:00 am   Post subject: RE:Maze game

thanks man, that solved the problem! Very Happy
Raknarg




PostPosted: Thu Apr 10, 2014 2:11 am   Post subject: RE:Maze game

However, if this is not for a class, I would seriously recommend looking up arrays, text files and doing this over again. you could write the same program in a fraction of the space, and it would be much cleaner
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: