Creating an Electronic Hangman in Turing

Anas
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Assignment #: 6-4 %
% Name: Suhail Patel (94980pat) %
% Date Due: November 14 2005 %
% Date Started: November 15 2005 %
% Program Name: Electronic Hangman %
% Program Version: 1.0 %
% Description: %
% %
% This is the 2 player electronic %
% version of hangman. One player enters %
% a puzzle, while the other player %
% trys to guess it %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% All variables declared here

var category:string
var player:int
var puzzle:string
var dashes:string:=""
var any_key:string(1)
var used_letters:string:=""
var counter:int:=0
var letter:string(1)
var alphabet:string:="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
var x:int:=35
var y:int:=375

% Change the background colour and text colour

colorback(black)
color(10)
cls

% Introduces the user to the program, and tells him/her how to use it

put "Welcome to the Electronic Hangman, in order to play this game, you must
have a partner to"..
put " play with. Your partner comes up with a puzzle for you to solve, and then
you solve it!"..
put " You must guess a letter between A-Z, and you have 6 chances to guess the
puzzle."
put ""

% Waits for user input before continuing

put "Are you ready to play? Hit any key to continue"
getch(any_key)

% Asks the user if he/she is player 1 or 2, error trap to make sure user enters
a preference

loop

put ""
put "Are you player(1) or player(2)?"
get player
put ""

% Loop exits when the user an apprpriate player preference(1 or 2)

exit when player=1 or player=2
put "Please enter player preference!"

end loop

% Ask the player to enter a puzzle for his/her partner to solve, error trap to
make
% sure the user enters a string of at least 1 character

loop

put "OK, player ",player," please enter a puzzle for your partner to solve!"
get puzzle:*
puzzle:= Str.Upper(puzzle)

% Loop exits when the user enters a puzzle of at least 1 letter

exit when length(puzzle)>0
put "Your puzzle must have at least one letter!"
put ""

end loop

% Ask the user to enter a category for the puzzle, error trap to make sure the
user enters a
% category of at least 1 character

loop

put ""
put "Please enter a category"
get category:*

% Loop exits when the length of the category is at least 1 character

exit when length(category)>0
put "You must enter at least 1 letter!"

end loop

% Convert the puzzle into dashes if it's a letter, space if it's a space, and
the actual letter
% if it's anything else

for i:1..length(puzzle)

if puzzle(i)>="A" and puzzle(i)dashes:=dashes+"-"

elsif puzzle(i)=" " then

dashes:=dashes+" "

else

dashes:=dashes+puzzle(i)

end if

end for

% Thank the user and wait for him/her to continue

put ""
put "Thank you! Please enter any key to continue:"
getch(any_key)

loop

% Clear the screen

cls

% Loop exits when the counter is 6, or the puzzle is equal to dashes

exit when counter=6 or puzzle=dashes

% Displays the graphics for the hangman character, depending on how many guesses
the user has left

if counter=0 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand

elsif counter=1 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head

elsif counter=2 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body

elsif counter=3 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm

elsif counter=4 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm

else

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm
drawline (x+80, y-125, x+55, y-145, 79)%Left leg

end if

% Display the category

locate(11, 25)
put "Category: ",category

% Display the letter the user hasn't guessed yet

locate(15, 25)
put alphabet

% Display the dashes

locate(13,25)
put dashes

% Tell the user to guess a letter

locate(1, 25)
put "Guess a letter!"

loop

% Ask the user to input a letter, if the user enters , then the puzzle will
be solved
% for him/her, error trap to make sure the user enters only letters and only one
letter

locate(25,1)
put "Please enter a letter, to solve the puzzle: "..
getch (letter)

% Converts the letter to uppercase

letter:=Str.Upper(letter)

% Loop exits when the user enters a letter with a length of 1, when the letter
isn't a letter
% the user already guessed, and when the letter is between A-Z. Or if the user
enters a 1.

exit when (length(letter)=1 and index(used_letters, letter)=0 and (letter>="A"
and lettercls

% Displays the graphics for the hangman character, depending on how many guesses
the user has left

if counter=0 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand

elsif counter=1 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head

elsif counter=2 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body

elsif counter=3 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm

elsif counter=4 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm

else

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm
drawline (x+80, y-125, x+55, y-145, 79)%Left leg
end if

% Display the category

locate(11, 25)
put "Category: ",category

% Display the letter the user hasn't guessed yet

locate(15, 25)
put alphabet

% Let the user know that he/she has to enter one letter, and the letter can't be
one that
% was already guessed

locate(23,1)
put "You must enter one letter, and the letter can't be a letter that you
already guessed!"

% Diaplay the dashes

locate(13,25)
put dashes

% Tell the user to guess a letter

locate(1, 25)
put "Guess a letter!"

end loop

% Main loop exits when the user enters 1 as the letter

exit when letter="1"

% Adds the letter to the string used_letters, next time if he user enters the
same character
% he/she won't be able to

used_letters:=used_letters+letter

% If the letter is in the alphabet, eliminate the letter, so it won't display
that letter next time

if letter>="A" and letteralphabet:=alphabet(1..index(alphabet,letter)-1) + " " + alphabet(index(alphabet,
letter)+1..*)

end if

% If the letter is not found in the puzzle, let the user know and tell him/her
how many
% guesses he/she has left.

if index(puzzle, letter)=0 then

cls
locate(1, 25)
put "There is no ",letter," in the puzzle!"

% Add 1 to the counter, every time the user guesses wrong

counter:=counter+1
locate(2,24)

% Let the user know how many guesses he/she used up

put "You used up ", counter, " out of 6 guesses!"

% Display the dashes

locate(13, 25)
put dashes

% Displays the graphics for the hangman character, depending on how many guesses
the user has left

if counter=0 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand

elsif counter=1 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head

elsif counter=2 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body

elsif counter=3 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm

elsif counter=4 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm

elsif counter=5 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm
drawline (x+80, y-125, x+55, y-145, 79)%Left leg

else

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm
drawline (x+80, y-125, x+55, y-145, 79)%Left leg
drawline (x+80, y-125, x+105, y-145, 79)%Right leg

end if

% Put a 3 second delay

delay(3000)

else

% If the letter was found in the puzzle, then the dashe(s) will be replaced by
the letter

for i:1..length(puzzle)

if puzzle(i)=letter then
dashes:=dashes(1..i-1)+puzzle(i)+dashes(i+1..*)
end if

end for

cls

% Let the user know that the letter was found in the puzzle

locate(1,20)
put "Congrats! The letter you guessed was found in the puzzle!"

% Display the dashes

locate(13,25)
put dashes

% Displays the graphics for the hangman character, depending on how many guesses
the user has left

if counter=0 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand

elsif counter=1 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head

elsif counter=2 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body

elsif counter=3 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm

elsif counter=4 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm

else

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm
drawline (x+80, y-125, x+55, y-145, 79)%Left leg

end if

% Put a 3 second delay

delay(3000)

end if

end loop

% If the user uses up all his/her guesses then

if counter=6 then

cls

% Let the user know that he/she lost

locate(1, 1)
put "Sorry, you lost! You used up 6 out of 6 chances! The actual puzzle is:"

% Display the actual puzzle

locate(13, 25)
put puzzle

% Thank the user fore playing the game

locate(24,1)
put "Thank you for playing Electronic Hangman! I hope you had fun!"

% Display the category

locate(11, 25)
put "Category: ",category

% Display the letter the user hasn't guessed yet

locate(15, 25)
put alphabet

% Display the full hangman character

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm
drawline (x+80, y-125, x+55, y-145, 79)%Left leg
drawline (x+80, y-125, x+105, y-145, 79)%Right leg

% If the user guesses the puzzle then

elsif puzzle=dashes then

cls

% Display the category

locate(11, 25)
put "Category: ",category

% Display the letter the user hasn't guessed yet

locate(15, 25)
put alphabet

% Congratulate the player for winning, display the actual puzzle

locate(2,25)
put "Congratulations! You guessed the puzzle!"
locate (13, 25)
put puzzle

% Thank the user for playing

locate(25,1)
put "Thank you for playing Electronic Hangman! I hope you had fun!"

if counter=0 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand

elsif counter=1 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head

elsif counter=2 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body

elsif counter=3 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm

elsif counter=4 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm

else

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm
drawline (x+80, y-125, x+55, y-145, 79)%Left leg

end if

else

% Clear the screen

cls

% Display the actual puzzle

locate(1, 25)
put "The actual puzzle was:"
locate(13, 25)
put puzzle

% Thank the user for playing

locate(24,1)
put "Thank you for playing Electronic Hangman! I hope you had fun!"

% Display the category

locate(11, 25)
put "Category: ",category

% Display the letter the user hasn't guessed yet

locate(15, 25)
put alphabet

% Displays the graphics for the hangman character, depending on how many guesses
the user has left

if counter=0 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand

elsif counter=1 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head

elsif counter=2 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body

elsif counter=3 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm

elsif counter=4 then

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm

else

drawline(x, y, x, y-170, 79)% Displays part of stand
drawline(x, y, x+80, y, 79)% Displays part of stand
drawline(x+80, y, x+80, y-35,79)% Displays part of stand
drawline(x-25, y-170, x+25, y-170, 79)% Displays part of stand
drawoval (x+80, y-50, 15, 15, 79)%Head
drawline (x+80, y-65, x+80, y-125, 79)%Body
drawline (x+80, y-65, x+55, y-85, 79)%Right arm
drawline (x+80, y-65, x+105, y-85, 79)%Left arm
drawline (x+80, y-125, x+55, y-145, 79)%Left leg

end if

end if

Published by Anas

Science Student  View profile

To comment, please sign in to your Yahoo! account, or sign up for a new account.