Anyone who has programmed in TI-Basic is likely to have written one of these programs. The concept for this program is simple.
The "ball" represented by a single point that originates from the upper left hand corner of the screen and bounces around the screen leaving a trail as it travels. The initial movement vector for the ball is (1,1), meaning one down, one right. During each pass through a loop, the "ball" is translated by the amount specified in the movement vector. When the ball would go of bounds, its movement vector is adjusted so that this does not happen. In short, it behaves like this:
enter image description here
except I increased the frame of the GIF.
I've reduced my code to a very short and clean snippet:
FnOff
PlotsOff
AxesOff
ClrDraw
{1,1→L1
Repeat getKey
Ans→L2
Pxl-Change(L1(1),L1(2
Ans+L1→L1
L2*(1-2not(Ans and Ans≠{62,94
End
FnOn
PlotsOn
AxesOn
ClrDraw
What I would like to hear in responses can be enumerated in four points:
- How can I reduce the size of this program?
- How can I increase the speed of this program?
- How can I reduce the numbers of variables used in this program?
- How can I increase the clarity of this program without sacrificing any of the goals stated above?
People responding to this post should also keep in mind that this code was written for and tested on a TI-83 Plus calculator.
Anyone who has programmed in TI-Basic is likely to have written one of these programs. The concept for this program is simple.
The "ball" represented by a single point that originates from the upper left hand corner of the screen and bounces around the screen leaving a trail as it travels. The initial movement vector for the ball is (1,1), meaning one down, one right. During each pass through a loop, the "ball" is translated by the amount specified in the movement vector. When the ball would go of bounds, its movement vector is adjusted so that this does not happen. In short, it behaves like this:
enter image description here
except I increased the frame of the GIF.
I've reduced my code to a very short and clean snippet:
FnOff
PlotsOff
AxesOff
ClrDraw
{1,1→L1
Repeat getKey
Ans→L2
Pxl-Change(L1(1),L1(2
Ans+L1→L1
L2*(1-2not(Ans and Ans≠{62,94
End
FnOn
PlotsOn
AxesOn
ClrDraw
What I would like to hear in responses can be enumerated in four points:
- How can I reduce the size of this program?
- How can I increase the speed of this program?
- How can I reduce the numbers of variables used in this program?
- How can I increase the clarity of this program without sacrificing any of the goals stated above?
Anyone who has programmed in TI-Basic is likely to have written one of these programs. The concept for this program is simple.
The "ball" represented by a single point that originates from the upper left hand corner of the screen and bounces around the screen leaving a trail as it travels. The initial movement vector for the ball is (1,1), meaning one down, one right. During each pass through a loop, the "ball" is translated by the amount specified in the movement vector. When the ball would go of bounds, its movement vector is adjusted so that this does not happen. In short, it behaves like this:
enter image description here
except I increased the frame of the GIF.
I've reduced my code to a very short and clean snippet:
FnOff
PlotsOff
AxesOff
ClrDraw
{1,1→L1
Repeat getKey
Ans→L2
Pxl-Change(L1(1),L1(2
Ans+L1→L1
L2*(1-2not(Ans and Ans≠{62,94
End
FnOn
PlotsOn
AxesOn
ClrDraw
What I would like to hear in responses can be enumerated in four points:
- How can I reduce the size of this program?
- How can I increase the speed of this program?
- How can I reduce the numbers of variables used in this program?
- How can I increase the clarity of this program without sacrificing any of the goals stated above?
People responding to this post should also keep in mind that this code was written for and tested on a TI-83 Plus calculator.
Anyone who has programmed in TI-Basic is likely to have written one of these programs. The concept for this program is simple.
The "ball" represented by a single point that originates from the upper left hand corner of the screen and bounces around the screen leaving a trail as it travels. The initial movement vector for the ball is (1,1), meaning one down, one right. During each pass through a loop, the "ball" is translated by the amount specified in the movement vector. When the ball would go of bounds, its movement vector is adjusted so that this does not happen. In short, it behaves like this:
enter image description here
except I increased the frame of the GIF.
I've reduced my code to a very short and clean snippet.:
FnOff
PlotsOff
AxesOff
ClrDraw
{1,1→L1
Repeat getKey
Ans→L2
Pxl-Change(L1(1),L1(2
Ans+L1→L1
L2*(1-2not(Ans and Ans≠{62,94
End
FnOn
PlotsOn
AxesOn
ClrDraw
What I would like to hear in responses can be enumerated in four points.:
- How tocan I reduce the size of this program.?
- How tocan I increase the speed of this program.?
- How can I reduce the numbers of variables used in this program.?
- How tocan I increase the clarity of this program without sacrificing any of the goals stated above.?
Anyone who has programmed in TI-Basic is likely to have written one of these programs. The concept for this program is simple.
The "ball" represented by a single point that originates from the upper left hand corner of the screen and bounces around the screen leaving a trail as it travels. The initial movement vector for the ball is (1,1), meaning one down, one right. During each pass through a loop, the "ball" is translated by the amount specified in the movement vector. When the ball would go of bounds, its movement vector is adjusted so that this does not happen. In short, it behaves like this:
enter image description here
except I increased the frame of the GIF.
I've reduced my code to a very short and clean snippet.
FnOff
PlotsOff
AxesOff
ClrDraw
{1,1→L1
Repeat getKey
Ans→L2
Pxl-Change(L1(1),L1(2
Ans+L1→L1
L2*(1-2not(Ans and Ans≠{62,94
End
FnOn
PlotsOn
AxesOn
ClrDraw
What I would like to hear in responses can be enumerated in four points.
- How to reduce the size of this program.
- How to increase the speed of this program.
- How reduce the numbers of variables used in this program.
- How to increase the clarity of this program without sacrificing any of the goals stated above.
Anyone who has programmed in TI-Basic is likely to have written one of these programs. The concept for this program is simple.
The "ball" represented by a single point that originates from the upper left hand corner of the screen and bounces around the screen leaving a trail as it travels. The initial movement vector for the ball is (1,1), meaning one down, one right. During each pass through a loop, the "ball" is translated by the amount specified in the movement vector. When the ball would go of bounds, its movement vector is adjusted so that this does not happen. In short, it behaves like this:
enter image description here
except I increased the frame of the GIF.
I've reduced my code to a very short and clean snippet:
FnOff
PlotsOff
AxesOff
ClrDraw
{1,1→L1
Repeat getKey
Ans→L2
Pxl-Change(L1(1),L1(2
Ans+L1→L1
L2*(1-2not(Ans and Ans≠{62,94
End
FnOn
PlotsOn
AxesOn
ClrDraw
What I would like to hear in responses can be enumerated in four points:
- How can I reduce the size of this program?
- How can I increase the speed of this program?
- How can I reduce the numbers of variables used in this program?
- How can I increase the clarity of this program without sacrificing any of the goals stated above?
TI-Basic Bouncing Ball Animation
Anyone who has programmed in TI-Basic is likely to have written one of these programs. The concept for this program is simple.
The "ball" represented by a single point that originates from the upper left hand corner of the screen and bounces around the screen leaving a trail as it travels. The initial movement vector for the ball is (1,1), meaning one down, one right. During each pass through a loop, the "ball" is translated by the amount specified in the movement vector. When the ball would go of bounds, its movement vector is adjusted so that this does not happen. In short, it behaves like this:
enter image description here
except I increased the frame of the GIF.
I've reduced my code to a very short and clean snippet.
FnOff
PlotsOff
AxesOff
ClrDraw
{1,1→L1
Repeat getKey
Ans→L2
Pxl-Change(L1(1),L1(2
Ans+L1→L1
L2*(1-2not(Ans and Ans≠{62,94
End
FnOn
PlotsOn
AxesOn
ClrDraw
What I would like to hear in responses can be enumerated in four points.
- How to reduce the size of this program.
- How to increase the speed of this program.
- How reduce the numbers of variables used in this program.
- How to increase the clarity of this program without sacrificing any of the goals stated above.