Computer Science Canada

ping pong

Author:  air_force91 [ Thu Nov 20, 2003 9:12 pm ]
Post subject:  ping pong

I wanted to display a ping pong game...REMEMBER:im a beginner

lol.

loop

put "! $ !"

delay(10)

put "! $ !"

delay(10)

put "! $!"

delay(10)

put "! $ !"

delay(10)

put "! $ !"

end loop


neways...i wanted to know...how could i move just the dollar sign back and forth within the bars (! !) instead of repeating the bars on the screen...thanx...

Author:  thoughtful [ Thu Nov 20, 2003 10:14 pm ]
Post subject: 

Bro you should stop posting 2 topics and try doing some work on your own. Or you will get the turing gurus mad Evil or Very Mad Evil or Very Mad Evil or Very Mad

Author:  Mazer [ Thu Nov 20, 2003 10:24 pm ]
Post subject: 

try this:
code:

var pos := 0 % position of the ball
var move := 1 % 1 = move right, -1 = move left

loop
    put "!", repeat (" ", pos), "$", repeat (" ", 5 - pos), "!"
    % put the !, then a number of spaces equal to the space between the left paddle and the ball, then the ball, and more space, then the right paddle
    delay (60) % 10ms is pretty short, for something so simple a bigger delay is better
    cls

    pos += move % increase the position by move (so, if move is negative, the ball moves to the left)
    if pos = 0 or pos = 5 then % if the ball hits a paddle, switch the direction
        move *= -1
    end if
end loop


thoughtful, i'm guessing the double post was a bug in the forum. and as for the program he did try doing it on his own.

Author:  AsianSensation [ Thu Nov 20, 2003 10:32 pm ]
Post subject: 

lol, I didn't even notice there were two posts...

anyways, Mazer did it the smart way, he actually thought about it, if you want to learn how to problem solve, use his, otherwise, if you are lazy, use mine, it's so much simpler when it comes to understanding. Razz

Author:  Mazer [ Thu Nov 20, 2003 10:37 pm ]
Post subject: 

yeah, yours is much simpler asian, but i don't like to use locate. i don't really know why...

Author:  thoughtful [ Fri Nov 21, 2003 12:33 am ]
Post subject: 

Hey i am sorry for criticising you airforce man....didnt know it was a bug.

Author:  morgoth [ Sun Nov 23, 2003 9:37 am ]
Post subject: 

LOL I was just thinking about the locate command and how much I hate it as well LOL Very Happy

-CHEERS!

Author:  air_force91 [ Sun Nov 23, 2003 12:03 pm ]
Post subject: 

wow...u got it all wrong...seriously...i only posted once...and i do my work on my own...is it a crime to ask ppl better than u out there for some help? and second of all...im not a "bro" or a "man"...im a girl...seriously...are only boys interested in planes and airforce? Rolling Eyes

Author:  rizzix [ Sun Nov 23, 2003 12:05 pm ]
Post subject: 

actually its not the planes and airforce.. its compsci.

Author:  thoughtful [ Sun Nov 23, 2003 6:54 pm ]
Post subject: 

LOL, its actually very rare to find girls here. Now tony might give you better attention if you are hot cause he told me his school doesn't has a lot of em Razz Razz Twisted Evil Twisted Evil

Author:  Andy [ Sun Nov 23, 2003 6:56 pm ]
Post subject: 

who's a girl?

Author:  thoughtful [ Sun Nov 23, 2003 7:01 pm ]
Post subject: 

airforce_91

Author:  Tony [ Sun Nov 23, 2003 7:03 pm ]
Post subject: 

umm... yeah... its true Laughing

Author:  air_force91 [ Sun Nov 23, 2003 8:44 pm ]
Post subject: 

u know...seriously...girls are interested in programming as well...ughhh... Rolling Eyes ....

Author:  Tony [ Sun Nov 23, 2003 9:50 pm ]
Post subject: 

air_force91 wrote:
girls are interested in programming as well


umm... no Confused not to my knowledge Thinking

Author:  thoughtful [ Sun Nov 23, 2003 10:49 pm ]
Post subject: 

Thoughtful: Earth to Aiforce, Earth to Airforce, do you live in the same universe? Razz Razz Razz Razz

Author:  air_force91 [ Tue Nov 25, 2003 8:33 am ]
Post subject: 

lol...i don't care...im interested in programming


: