Computer Science Canada

Procedure issue [SOLVED]

Author:  Stickman [ Wed Jun 08, 2022 3:22 pm ]
Post subject:  Procedure issue [SOLVED]

What is it you are trying to achieve?
tryna make an option where it pick a shape and the program will draw that shape

What is the problem you are having?
turning trying to delete almost all my code

Describe what you have tried to solve this problem
it a procedure i typed it in right but it saying it not correct

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


setscreen ("graphic")

var x: int
var randx: int
var y: int
var randy: int
var option: int
var mx: int
var my: int
var looppoint: int
var point: int
mx :=0
my :=0

looppoint :=1
point := 1
procedure star
    drawstar(x, y, mx, my, white)
end star

procedure leaf
    drawmapleleaf (x, y, mx, my, white)
end leaf

procedure randomise
        randint (randx, 1, 100)
        randint (randy, 1, 100)
        drawline (randx, randy, maxx,maxy
        get option
    exit when option = 2
    end loop
end randomise

put "Select a shape"
put "[1] Star"
put "[2] leaf"
put "[3] random"
get option

if option = 1 then
    put "lenght"
    get x
    put "height"
    get y
    put "max lenght"
    get mx
    put "max height"
    get my
elsif option = 2 then
    put "lenght"
    get x
    put "height"
    get y
    put "max lenght"
    get mx
    put "max height"
    get my
elsif option = 3 then
end if

Please specify what version of Turing you are using
recent ver