- Joined
- Apr 19, 2011
- Messages
- 1,331
So, i did a simple program on my Casio in maths today that colors one pixel on 2 on the screen in that scheme :
010101010
101010101
010101010
101010101
010101010
(1 being colored pixels and 0 blank pixels).
My current problem is that the program takes a long time to do the whole screen, and so i would like to fasten it a bit if there's any way to optimize the code.
With that code, it takes a few minutes to have the grid on the whole screen, and that's quite a problem. So i'm searching ways to make it faster if it's possible. So, hmm any ideas ?
010101010
101010101
010101010
101010101
010101010
(1 being colored pixels and 0 blank pixels).
My current problem is that the program takes a long time to do the whole screen, and so i would like to fasten it a bit if there's any way to optimize the code.
Code:
//Graphics Parameters
ViewWindow 1, 127, 0, 1, 63, 0
AxesOff
GridOff
LabelOff
//Grid Creation
2->A
1->B
While B=!64
PxlOn B,A
If A<125
Then A+2->A
Else A-125->A
B+1->B
IfEnd
WhileEnd
//Keeping the grid on the screen until Exe is pressed
While Getkey=!31
WhileEnd
//Resetting Graphics Parameters, Variables & such to default
Prog "INITCONF"
With that code, it takes a few minutes to have the grid on the whole screen, and that's quite a problem. So i'm searching ways to make it faster if it's possible. So, hmm any ideas ?