- Homescreen Drawing Program
- 03 Oct 2015 11:53:46 pm
- Last edited by Ekyl on 22 Nov 2015 06:08:36 pm; edited 11 times in total
Here's a home screen drawing program I wrote. You can toggle whether or not you interact with the drawing by pressing ENTER, and the plus and minus keys change between pen and eraser. It actively stores your drawing in a list, so when you re-open the program it'll load it up.
(It's a bit laggy in the gif, but that's just how jsTIfied's recording thing works.)
If you could help me optimize my program, that'd be awesome. Post your suggestions down below. (I need an explanation of what you're doing, so I can learn.)
Main issue: It's not very fast when I switch draw/erase and pen down/up.
Code:
(It's a bit laggy in the gif, but that's just how jsTIfied's recording thing works.)
Updated menu to work with arrow keys as well as number keys. 10/7/15
Changed to custom menus for speed. 10/7/15
Added compatibility with all TI-83/84 calculators. 10/6/15
Minor performance improvements. 11/22/15
If you could help me optimize my program, that'd be awesome. Post your suggestions down below. (I need an explanation of what you're doing, so I can learn.)
Main issue: It's not very fast when I switch draw/erase and pen down/up.
Code:
ClrHome
2->dim(|LSCRN
If not(|LSCRN(1
Then
Disp "CALCULATOR MODEL
Output(2,1," TI-83/84/+
Output(3,1," TI-84+ Color
2->S
0->C
Repeat C and max(K={92,93,24,34,105
getKey->K
If Ans
Output(S,1,"
min(3,max(2,S+sum(DeltaList(K={25,34->S
Output(S,1,"[|>]
If K=105
90+S->K
If K=92:Then
16->|LSCRN(1
8->|LSCRN(2
1->C
End
If K=93:Then
26->|LSCRN(1
10->|LSCRN(2
1->C
End
End
End
|LSCRN(1->W
|LSCRN(2->H
prod(|LSCRN->dim(|LDRWDB
Lbl 0
ClrHome
"#->Str3
"+->Str2
1->Y
0->D
1->M
1->I
W-7->J
Output(H,J,"Loading...
For(Y,1,H
For(X,1,W
If |LDRWDB(I):Then
Output(Y,X,Str3
Else
Output(Y,X,"
End
I+1->I
End
End
8->X
4->Y
Lbl 1
Repeat max(K={21,23,45
(Y-1)W+X->I
getKey->K
If Ans:Then
If D:Then
Output(Y,X,Str1
M->|LDRWDB(I)
Else
If |LDRWDB(I):Then
Output(Y,X,Str3
Else
Output(Y,X,"
End
End
End
min(H,max(1,Y+sum(DeltaList(K={25,34->Y
min(W,max(1,X+sum(DeltaList(K={24,26->X
Output(Y,Ans,Str2
If K=85
0->M
If K=95
1->M
If M:Then
Str3->Str1
"plotcross->Str2
If D
"+->Str2
Else
" ->Str1
"plotsquare->Str2
If D
"o->Str2
End
If K=105
not(D->D
End
ClrHome
Disp "MENU
Output(2,1," Back
Output(3,1," Quit
Output(4,1," Clear
Output(5,1," Help
2->S
0->C
Repeat C and max(K={92,93,24,34,105
getKey->K
If Ans
Output(S,1,"
min(5,max(2,S+sum(DeltaList(K={25,34->S
Output(S,1,"[|>]
If S=5 and K=105
82->K
If K=105
90+S->K
If K=92
Goto 0
If K=93:Then
ClrHome
Stop
End
If K=94:Then
Fill(0,|LDRWDB
ClrHome
Goto 1
End
If K=82:Then
ClrHome
Disp "Move with arrows","","Toggle pen up or","down with ENTER","","+ Key: Draw","- Key: Erase
Pause
ClrHome
Goto 0
End
End