Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ClrHome //Clear The Home Screen
- 3→A:1→X:3→Y //Sets The Paddle X coordinate to 3, and sets the ball coordinates
- 1→S:1→T:0→R //Sets the ball directions to positive, and sets score to 0
- Repeat K=45 or Y=10 and not(A≤X and A+2≥X //Repeats the loop until keypress=clear or ball touches ground without paddle
- Output(Y,X,"O //outputs the ball
- getKey→K //senses if there is a keypress
- If K=24 or K=26 //if the keypress is left or right arrow
- Output(10,A," //(3 spaces) deletes the paddle from the screen for a split second to relocate it
- max(1,min(24,A+2(K=26)-2(K=24→A //sets paddle boundaries and stores a new coordinate for the paddle if left or right arrow was pressed
- Output(10,A,"--- //outputs the paddle
- T(Y>1 and Y<10)+(Y=1)-(Y=10→T //sets the Y direction of the ball
- S(X>1 and X<26)+(X=1)-(X=26→S //sets the X direction of the ball
- Output(Y,X," //(one space) takes ball of screen to relocate it with new coordinates
- X+Ans→X:Y+T→Y //adds positive or negative values to the ball's coordinates
- R+1→R //adds one to the score
- End //end of the loop,so the cpu jumps back to "repeat"
- Disp "SCORE:",R //displays score
- Pause "GAME OVER! //displays "game over" at the same time of it pausing the program
- ClrHome:" //clears home screen and " prevents the "Done" message from being displayed (for cleanliness of program)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement