Computer Science Canada

PLEASE HELP FAASSSTT>>Project Due Tomorrow!!!

Author:  Kaptesh [ Wed Jan 19, 2005 8:31 pm ]
Post subject:  PLEASE HELP FAASSSTT>>Project Due Tomorrow!!!

Hey guys please help me...I'm a TOTAL newbie..
code:

var chars : array char of boolean
var x, y, c : int
x := 4
y := 4
c := Rand.Int (0, maxcolor)



loop


    Input.KeyDown (chars)

    if chars (KEY_UP_ARROW) then
        y := y + 5
        delay (5)

    elsif chars (KEY_RIGHT_ARROW) then
        x := x + 5
        delay (5)

    elsif chars (KEY_LEFT_ARROW) then
        x := x - 5
        delay (5)

    elsif chars (KEY_DOWN_ARROW) then
        y := y - 5
        delay (5)

    elsif chars (KEY_ALT) then
        if y>0 then drawfilloval (x, y, 10, 10, Rand.Int (0, maxcolor))
        end if
delay (500)
    end if

    drawfilloval (x, y, 4, 4, c)
    delay (5)

end loop

Everything works..but when I press ALT I want the ball to change colour and draw with that new colour..Please someone help!!! Sad Sad

Author:  Martin [ Wed Jan 19, 2005 8:34 pm ]
Post subject: 

code:
elsif chars (KEY_ALT) then
    c := Rand.Int(0,maxcolor)
else ...


That's all you need.

Also, you should make them seperate if statements (ie. if keys(KEY_UP_ARROW) then ... end if if keys (KEY_LEFT_ARROW) then .. end if)

That way, if users press up and left, it moves the ball up and left.

Author:  Kaptesh [ Wed Jan 19, 2005 9:03 pm ]
Post subject: 

Wow...that was fast..thankks man it works... Very Happy

Author:  Tony [ Thu Jan 20, 2005 9:30 am ]
Post subject: 

that's his project?
Shocked
just imagine that kind of an awesome colour changing program this kid would be able to make once he graduates from that school Laughing

Author:  Neo [ Thu Jan 20, 2005 10:28 am ]
Post subject: 

tony wrote:
that's his project?
Shocked
just imagine that kind of an awesome colour changing program this kid would be able to make once he graduates from that school Laughing


It probably is just a small protion of his final project, the larger part is a 3D FPS with dynamic lighting and the like. Laughing

Author:  Pip_Jr [ Thu Jan 20, 2005 10:09 pm ]
Post subject: 

Dude... My project is harder then that... adn i'm in grade 9 and i'm geting pissed off! couse my teacher is being an ass Twisted Evil

I need to make hang man with arrays and proccedures, and i lost my notes =S

Author:  eNc [ Fri Jan 21, 2005 9:49 am ]
Post subject: 

Pip_Jr wrote:
Dude... My project is harder then that... adn i'm in grade 9 and i'm geting pissed off! couse my teacher is being an ass Twisted Evil

I need to make hang man with arrays and proccedures, and i lost my notes =S


Lost or didn't take ? I kno im compsci I never take notes lol.

Author:  Tony [ Fri Jan 21, 2005 12:38 pm ]
Post subject: 

the only notes there are to take is proper syntax reference..

and I just print out the documentation that comes with whatever library I'm using Wink

Author:  MysticVegeta [ Sat Jan 22, 2005 11:15 am ]
Post subject: 

Pip_Jr wrote:
Dude... My project is harder then that... adn i'm in grade 9 and i'm geting pissed off! couse my teacher is being an ass Twisted Evil

I need to make hang man with arrays and proccedures, and i lost my notes =S


Wow i got hangman for isp too and i handed it in. Its not that hard!!! Very Happy


: