Computer Science Canada

I'm a special type of stupid

Author:  iFlexion [ Wed Mar 11, 2020 9:37 am ]
Post subject:  I'm a special type of stupid

What is it you are trying to achieve?
make a pet simulator


What is the problem you are having?
lost all brain cells


Describe what you have tried to solve this problem
regaining brain cells

it didnt work
--------------im terrible at this pls help me-------------------------- no roasting please Crying or Very sad
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:


import GUI
var normalFont : int
var titleFont : int

% makes screen big
setscreen ("graphics:max;max,")
% intro
normalFont := Font.New ("Biome:16")
titleFont := Font.New ("Biome:28")
Font.Draw ("Hello and welcome to the virtual pet simulator.", 75, 550, titleFont, blue)
Font.Draw ("Here you can create a pet for free!", 85, 500, normalFont, blue)
delay (5000)
cls
Font.Draw ("To continue press any key!", 85, 450, normalFont, blue)
loop % waits to continue
    exit when hasch
end loop
cls
%procedures
procedure chooseBird
    var pet : nat1
    pet := 3
end chooseBird

procedure chooseDog
    var pet : nat1
    pet := 1
end chooseDog

procedure chooseCat
    var pet : nat1
    pet := 2
end chooseCat



% creates GUI with procedures assigning values based on which button they click
% each button corresponds to a pet ranging from 1 to 10 all inclusive
var pet : nat1

var dogButton : int := GUI.CreateButton (85, 550, 0, "Dog ", chooseDog)

var catButton : int := GUI.CreateButton (85, 500, 0, "Cat ", chooseCat)

var birdButton : int := GUI.CreateButton (85, 450, 0, "Bird", chooseBird)

loop
    exit when GUI.ProcessEvent
end loop

procedure HideGUI
    GUI.Hide (dogButton)
    GUI.Hide (catButton)
    GUI.Hide (birdButton)
end HideGUI

loop
    if pet > 0 then
        exit
    end if
end loop
HideGUI
loop
    if pet = 1 then
        Font.Draw ("You chose dog!", 85, 550, titleFont, blue)
    end if
    if pet = 2 then
        Font.Draw ("You chose cat!", 85, 550, titleFont, blue)
    end if
    if pet = 3 then
        Font.Draw ("You chose bird!", 85, 550, titleFont, blue)
    end if




Author:  iFlexion [ Wed Mar 11, 2020 9:38 am ]
Post subject:  Re: I'm a special type of stupid

can someone make a list of all the things wrong with this code(assuming its short enough to fit in 1 forum post)

Author:  Insectoid [ Wed Apr 01, 2020 12:36 pm ]
Post subject:  RE:I\'m a special type of stupid

What specifically are you trying to do, and what specifically doesn't work?

Author:  TokenHerbz [ Mon Apr 13, 2020 4:56 am ]
Post subject:  RE:I\'m a special type of stupid

you are so dumb you dont have an end code...


: