Should I make an 8x8 version?
Yes, I'll use it
 50%  [ 2 ]
No, most people who use icons use 16x16 ones.
 50%  [ 2 ]
Total Votes : 4

(no longer) Current code:


Code:
::"Icon Editor for the 83+
::"7FF0411057105450567052505E48404440687FF4000CEEE948AD48AB48A9EEE949636F6E2046696C6500C9"
:Lbl ST
:ClrDraw
:PlotsOff
:FnOff
:AxesOff
:For(A,0,62)
:Pxl-On(A,0)
:Pxl-On(A,64)
:End
:For(A,1,63
:For(B,4,63,4
:Pxl-On(A-1,B)
:Pxl-On(B-1,A)
:End
:End
:Text(0,66,"[CLEAR]")
:Text(6,77,"=Quit")
:For(A,0,17)
:For(B,0,17,17)
:Pxl-On(A+13,B+70)
:Pxl-On(B+13,A+70)
:End
:End
:Text(31,66,"[DEL]="
:Text(37,83,"Clr")
:95→B
:56→A
:Repeat B=77
:B-1→B
:Pxl-On(A,B)
:End
:Pxl-Off(A,B)
:Repeat A=62
:A+1→A
:Pxl-On(A,B)
:End
:Text(57,79,"Save")
:1→C:1→D
:Lbl Z
:Repeat 0
:0→K
:Pxl-Change(4C-2,4D-1)
:Pxl-Change(4C-4,4D-1)
:Pxl-Change(4C-2,4D-3)
:Pxl-Change(4C-4,4D-3)
:Repeat (iPart(K/10)=2) or K=15 or K=34 or iPart(K/10)=4
:getKey→K
:End
:If K=22:Goto M1
:If (K≥42 and K≤44)
:Then
:{16,16}→dim([A])
:For(A,1,16
:For(B,1,16
:Pxl-Off(A+13,B+70)
:0
:If pxl-Test(4A-3,4B-1)
:1
:Ans→[A](A,B)
:Pxl-Change(4A-3,4B-2)
:End:End
:End
:If K=43 or K=44
:Then
:For(Z,1,8)
:rowSwap([A],Z,17-Z)→[A]
:End
:End
:If K=42 or K=44
:Then
:[A]{^T}→[A]
:For(Z,1,8)
:rowSwap([A],Z,17-Z)→[A]
:End
:[A]{^T}→[A]
:End
:If (K≥42 and K≤44)
:Then
:For(A,1,16)
:For(B,1,16)
:If [A](A,B)
:Then
:For(E,4A-4,4A-2)
:For(F,4B-3,4B-1)
:Pxl-On(E,F)
:End
:End
:Pxl-On(A+13,B+70)
:Else
:For(E,4A-4,4A-2)
:For(F,4B-3,4B-1)
:Pxl-Off(E,F)
:End
:End
:Pxl-Off(A+13,B+70)
:End
:End
:End
:End
:If K=41
:Then
:For(A,1,16)
:For(B,1,16)
:For(E,4A-4,4A-2
:For(F,4B-3,4B-1
:Pxl-Change(E,F)
:End
:End
:Pxl-Change(A+13,B+70)
:End
:End
:End
:If (K≥24 and K≤26) or K=34 or K=41
:Then
:Pxl-Change(4C-2,4D-1)
:Pxl-Change(4C-2,4D-3)
:Pxl-Change(4C-4,4D-1)
:Pxl-Change(4C-4,4D-3)
:End
:If K=24 and D≠1
:D-1→D
:If K=25 and C≠1
:C-1→C
:If K=26 and D≠16
:D+1→D
:If K=34 and C≠16
:C+1→C
:If K=21
:Then
:Pxl-Change(4C-2,4D-2)
:Pxl-Change(4C-3,4D-1)
:Pxl-Change(4C-3,4D-2)
:Pxl-Change(4C-3,4D-3)
:Pxl-Change(4C-4,4D-2)
:Pxl-Change(C+13,D+70)
:End
:If K=23
:Goto ST
:If K=15
:Goto SA
:If K=45
:Goto Q
:End
:End
:Lbl M1
:Pxl-Change(4C-2,4D-1)
:Pxl-Change(4C-2,4D-3)
:Pxl-Change(4C-4,4D-1)
:Pxl-Change(4C-4,4D-3)
:Lbl M
:Menu("Recall what?    ","Kerm's Icons",KI,"Yarnot Icons",YI,"Last Icon made",LI,"...Back",Z)
:Lbl KI
:Menu("Recall what? (K)","Folder icon",FI,"BASIC prog icon",BI,"ASM prog icon",AI,"ION prog icon",II,"DCS prog icon",DI,"...Back",M)
:Lbl YI
:Menu("Recall what? (Y)","Group icon",GI,"Flash App icon",FA,"...Back",M)
:Lbl LI
:0:Asm(prgmSTREXIST)
:If Ans=1:Then
:If length(Str0)≥66:Then
:2→X:Repeat X=66:X+1→X
:If inString("0123456789ABCDEF",sub(Str0,X,1))=0:Goto Z
:End
:sub(Str0,3,64)→Str3:End
:Else:Goto Z
:End:
:Goto Y
:Lbl FI:"Folder"
:"000038F04708801C80E2870288045004500450045008503033C03C0000000000"→Str3
:Goto Y
:Lbl BI:"BASIC"
:"C000A000E6D392849654E6D300000004FB86A93F2106738400337F4A00490033"→Str3
:Goto Y
:Lbl AI:"ASM"
:"200050005368FA5489548B5400000004FB86A93F2106738400337F4A00490033"→Str3
:Goto Y
:Lbl II:"ION"
:"7DD2822D6EAD2AA52AA96EAD822D7DD200000006380B5C2F8EA6DE80FEA67C2B"→Str3
:Goto Y
:Lbl DI:"DCS"
:"7FD27FD54FD543C941C041D141D145D141CE41C041CE31110D11031F00000000"→Str3
:Goto Y
:Lbl GI:"Group"
:"38F04708801C80E28702880455545FFC5AAC500851F036003B66045505660354"→Str3
:Goto Y
:Lbl FA:"Flash app"
:"1000299829547D984510451200000004FB86A93F2106738400337F4A00490033"→Str3
:Lbl Y
:" "→Str4
:For(X,1,64)
:Str4+sub("000000010010001101000101011001111000100110101011110011101111",4inString("0123456789ABCDEF",sub(Str3,X,1))-3,4)→Str4
:For(Y,16fPart(X/4)+1,16fPart(X/4)+4)
:Pxl-Change(4iPart(X/4)+1,4Y-2)
:Pxl-Off(iPart(X/4)+14,Y+70)
:End
:End
:For(X,1,16)
:For(Y,1,16)
:For(U,4X-3,4X-1)
:For(V,4Y-3,4Y-1)
:If sub(Str4,Y+16X-16)="1"
:Then:Pxl-On(U,V)
:Else:Pxl-Off(U,V)
:End
:End:End
:If sub(Str4,Y+16X-16)="1"
:Pxl-On(Y+13,X+70)
:End:End
:Goto Z
:Lbl SA
:Text(46,85,"I%
:Text(46,85,"   
:":→Str1
:For(C,1,16
:For(D,1,16
:"0
:If pxl-Test(4C-3,4D-1)
:"1
:Str1+Ans→Str1
:Pxl-Change(4C-3,4D-2
:If int(50length(Str1)/256)=0
:Then
:Text(46,85,0)
:Else
:Text(46,85-4iPart(log(int(50length(Str1)/256))),int(50(length(Str1)/256
:End
:End:End
:sub(Str1,2,length(Str1)-1→Str1
:":→Str0
:For(X,1,length(Str1),4
:Text(46,85-4iPart(log(int(50(X/255)+50))),int(50(X/255)+50
:sub(Str1,X,4→Str2
:sub("0124936DA5B7FEC8",inString("0000100110101111000",Str2),1
:Str0+Ans→Str0
:End
:sub(Str0,2,length(Str0)-1→Str0
:"AsmPrgm:"+Str0+"49636F6E2046696C6500C9→Str0
:Text(46,77,100
:Pause
:Lbl Q
:ClrDraw
:ClrHome
:Output(1,1,"


Any optimizations? (I am taking Will_W's into consideration)
Looking good, but
1) Why all the concluding parentheses and quotes? You can omit all those.
2) The following block of code:
Code:
:95→B
:56→A
:Repeat B=77
:B-1→B
:Pxl-On(A,B)
:End
:Pxl-Off(A,B)
:Repeat A=62
:A+1→A
:Pxl-On(A,B)
:End
Why not:
Code:
For(B,94,78,-1
Pxl-On(56,B
End:Pxl-Off(56,77
For(A,57,62
Pxl-On(A,77
End
New code, including 2 uses of Weregoose's "epic optimization win"


Code:
::"Icon Editor for the 83+
::"7FF0411057105450567052505E48404440687FF4000CEEE948AD48AB48A9EEE949636F6E2046696C6500C9"
:Lbl ST
:ClrDraw
:PlotsOff
:FnOff
:AxesOff
:For(A,0,62)
:Pxl-On(A,0)
:Pxl-On(A,64)
:End
:For(A,1,63
:For(B,4,63,4
:Pxl-On(A-1,B)
:Pxl-On(B-1,A)
:End
:End
:Text(0,66,"[CLEAR]")
:Text(6,77,"=Quit")
:For(A,0,17)
:For(B,0,17,17)
:Pxl-On(A+13,B+70)
:Pxl-On(B+13,A+70)
:End
:End
:Text(31,66,"[DEL]="
:Text(37,83,"Clr")
:For(B,94,78,-1
:Pxl-On(56,B
:End:Pxl-Off(56,77
:For(A,57,62
:Pxl-On(A,77
:End
:Text(57,79,"Save")
:1→C:1→D
:Lbl Z
:Repeat 0
:Delvar KPxl-Change(4C-2,4D-1)
:Pxl-Change(4C-4,4D-1)
:Pxl-Change(4C-2,4D-3)
:Pxl-Change(4C-4,4D-3)
:Repeat (iPart(K/10)=2) or K=15 or K=34 or iPart(K/10)=4
:getKey→K
:End
:If K=22:Goto M1
:If (K≥42 and K≤44)
:Then
:{16,16}→dim([A])
:For(A,1,16
:4A-3→Y
:For(B,1,16
:Pxl-Off(A+13,B+70)
:pxl-Test(Y,4B-1→[A](A,B
:Pxl-Change(Y,4B-2)
:End:End
:End
:If K=43 or K=44
:Then
:For(Z,1,8)
:rowSwap([A],Z,17-Z)→[A]
:End
:End
:If K=42 or K=44
:Then
:[A]{^T}→[A]
:For(Z,1,8)
:rowSwap([A],Z,17-Z)→[A]
:End
:[A]{^T}→[A]
:End
:If (K≥42 and K≤44)
:Then
:For(A,1,16)
:For(B,1,16)
:If [A](A,B)
:Then
:For(E,4A-4,4A-2)
:For(F,4B-3,4B-1)
:Pxl-On(E,F)
:End
:End
:Pxl-On(A+13,B+70)
:Else
:For(E,4A-4,4A-2)
:For(F,4B-3,4B-1)
:Pxl-Off(E,F)
:End
:End
:Pxl-Off(A+13,B+70)
:End
:End
:End
:End
:If K=41
:Then
:For(A,1,16)
:For(B,1,16)
:For(E,4A-4,4A-2
:For(F,4B-3,4B-1
:Pxl-Change(E,F)
:End
:End
:Pxl-Change(A+13,B+70)
:End
:End
:End
:If K≥24 and K≤26 or K=34 or K=41
:Then
:Pxl-Change(4C-2,4D-1)
:Pxl-Change(4C-2,4D-3)
:Pxl-Change(4C-4,4D-1)
:Pxl-Change(4C-4,4D-3)
:End
:D-(K=24 and D≠1)+(K=26 and D≠16)→D
:C-(K=25 and C≠1)+(K=34 and C≠16)→C
:If K=21
:Then
:Pxl-Change(4C-2,4D-2)
:Pxl-Change(4C-3,4D-1)
:Pxl-Change(4C-3,4D-2)
:Pxl-Change(4C-3,4D-3)
:Pxl-Change(4C-4,4D-2)
:Pxl-Change(C+13,D+70)
:End
:If K=23
:Goto ST
:If K=15
:Goto SA
:If K=45
:Goto Q
:End
:End
:Lbl M1
:Pxl-Change(4C-2,4D-1)
:Pxl-Change(4C-2,4D-3)
:Pxl-Change(4C-4,4D-1)
:Pxl-Change(4C-4,4D-3)
:Lbl M
:Menu("Recall what?    ","Kerm's Icons",KI,"Yarnot Icons",YI,"Last Icon made",LI,"...Back",Z)
:Lbl KI
:Menu("Recall what? (K)","Folder icon",FI,"BASIC prog icon",BI,"ASM prog icon",AI,"ION prog icon",II,"DCS prog icon",DI,"...Back",M)
:Lbl YI
:Menu("Recall what? (Y)","Group icon",GI,"Flash App icon",FA,"...Back",M)
:Lbl LI
:0:Asm(prgmSTREXIST)
:If Ans=1:Then
:If length(Str0)≥66:Then
:2→X:Repeat X=66:X+1→X
:If inString("0123456789ABCDEF",sub(Str0,X,1))=0:Goto Z
:End
:sub(Str0,3,64)→Str3:End
:Else:Goto Z
:End:
:Goto Y
:Lbl FI:"Folder"
:"000038F04708801C80E2870288045004500450045008503033C03C0000000000"→Str3
:Goto Y
:Lbl BI:"BASIC"
:"C000A000E6D392849654E6D300000004FB86A93F2106738400337F4A00490033"→Str3
:Goto Y
:Lbl AI:"ASM"
:"200050005368FA5489548B5400000004FB86A93F2106738400337F4A00490033"→Str3
:Goto Y
:Lbl II:"ION"
:"7DD2822D6EAD2AA52AA96EAD822D7DD200000006380B5C2F8EA6DE80FEA67C2B"→Str3
:Goto Y
:Lbl DI:"DCS"
:"7FD27FD54FD543C941C041D141D145D141CE41C041CE31110D11031F00000000"→Str3
:Goto Y
:Lbl GI:"Group"
:"38F04708801C80E28702880455545FFC5AAC500851F036003B66045505660354"→Str3
:Goto Y
:Lbl FA:"Flash app"
:"1000299829547D984510451200000004FB86A93F2106738400337F4A00490033"→Str3
:Lbl Y
:" "→Str4
:For(X,1,64)
:Str4+sub("0000100110101111000",inString("0124936DA5B7FEC8",sub(Str3,X,1),4)→Str4
:For(Y,16fPart(X/4)+1,16fPart(X/4)+4)
:Pxl-Change(4iPart(X/4)+1,4Y-2)
:Pxl-Off(iPart(X/4)+14,Y+70)
:End
:End
:For(X,1,16)
:For(Y,1,16)
:For(U,4X-3,4X-1)
:For(V,4Y-3,4Y-1)
:If sub(Str4,Y+16X-16)="1"
:Then:Pxl-On(U,V)
:Else:Pxl-Off(U,V)
:End
:End:End
:If sub(Str4,Y+16X-16)="1"
:Pxl-On(Y+13,X+70)
:End:End
:Goto Z
:Lbl SA
:Text(46,85,"I%
:Text(46,85,"   
:":→Str1
:For(C,1,16
:4C-3→Y
:For(D,1,16
:Str1+sub("01",pxl-Test(Y,4D-1)+1),1→Str1
:Pxl-Change(4C-3,4D-2
:If int(50length(Str1)/256)=0
:Then
:Text(46,85,0)
:Else
:Text(46,85-4iPart(log(50length(Str1)/256)),int(50(length(Str1)/256
:End
:End:End
:sub(Str1,2,length(Str1)-1→Str1
:":→Str0
:For(X,1,length(Str1),4
:Text(46,85-4iPart(log(50(X/255)+50)),int(50(X/255)+50
:sub(Str1,X,4→Str2
:sub("0124936DA5B7FEC8",inString("0000100110101111000",Str2),1
:Str0+Ans→Str0
:End
:sub(Str0,2,length(Str0)-1→Str0
:"AsmPrgm:"+Str0+"49636F6E2046696C6500C9→Str0
:Text(46,77,100
:Pause
:Lbl Q
:ClrDraw
:ClrHome
:Output(1,1,"
Just something random, you can change:


Code:
:If int(50length(Str1)/256)=0
:Then
:Text(46,85,0)
:Else
:Text(46,85-4iPart(log(50length(Str1)/256)),int(50(length(Str1)/256
:End
to
Code:
:Text(46,85-4(int(50length(Str1)/256)=/=0)iPart(log(50length(Str1)/256)),int(50(length(Str1)/256
KermMartian wrote:
Just something random, you can change:


Code:
:If int(50length(Str1)/256)=0
:Then
:Text(46,85,0)
:Else
:Text(46,85-4iPart(log(50length(Str1)/256)),int(50(length(Str1)/256
:End
to
Code:
:Text(46,85-4(int(50length(Str1)/256)=/=0)iPart(log(50length(Str1)/256)),int(50(length(Str1)/256

No I can't. That is my error-proofing coming into play. If X=0, iPart(log(X)) throws up an error, and it still calculates the stuff after a conditional, even if the conditional throws up FALSE (or 0).

Code:
1→C:1→D



I would change that to


:1->C
:1->D[/code]

Code:
1->C:1->D
saves vertical space which, in a large program like this, can be a good thing if/when you go edit part of it Razz
steelersfan1693 wrote:

Code:
1→C:1→D



I would change that to


:1->C
:1->D[/code]
You would indeed, and you'd be wrong. 1->C:1->D does exactly the same thing as 1->C:[newline]1->D, and saves scrolling. However, don't go insane in the opposite direction and make your entire program a single line.
Xeno_Cre8or wrote:
If X=0, iPart(log(X)) throws up an error, and it still calculates the stuff after a conditional, even if the conditional throws up FALSE (or 0).

Code:
:5.12‾¹length(Str1
:Text(46,85-4iPart(log(Ans+not(Ans))),int(Ans


As an aside, you appear to have picked the larger of the two optimizations. I wasn't expecting that. Confused
Weregoose wrote:
Xeno_Cre8or wrote:
If X=0, iPart(log(X)) throws up an error, and it still calculates the stuff after a conditional, even if the conditional throws up FALSE (or 0).

Code:
:5.12‾¹length(Str1
:Text(46,85-4iPart(log(Ans+not(Ans))),int(Ans


As an aside, you appear to have picked the larger of the two optimizations. I wasn't expecting that. Confused
Yeah, that was going to be my next suggestion, but I got distracted working on my thesis and forgot to post it. Sad Thanks Weregoose. Smile
Weregoose wrote:
As an aside, you appear to have picked the larger of the two optimizations. I wasn't expecting that. Confused


I didn't know if the other one would work, because it looks like it treats a binary number as a decimal one. Also, the larger one was easier to reverse.


Code:
:sub(Str1,X,4→Str2
:If Str2="0000    :"0
:If Str2="0001    :"1
:If Str2="0010    :"2
:If Str2="0011    :"3
:If Str2="0100    :"4
:If Str2="0101    :"5
:If Str2="0110    :"6
:If Str2="0111    :"7
:If Str2="1000    :"8
:If Str2="1001    :"9
:If Str2="1010    :"A
:If Str2="1011    :"B
:If Str2="1100    :"C
:If Str2="1101    :"D
:If Str2="1110    :"E
:If Str2="1111    :"F
:Str0+Ans→Str0

,with your "Epic optimization win", became

Code:
:Str0+sub("0124936DA5B7FEC8",inString("0000100110101111000",sub(Str1,X,4)),1)→Str0


33 lines compressed into 1!

Then when I added the recaller (allows you to recall the DCS default icons, and the last icon made), I reversed it.


Code:
sub("0000000100100011010001010110011110001001101010111100110111101111",4inString("0123456789ABCDEF",sub(Str1,X,1))-3,1)

became

Code:
sub("0000100110101111000",inString("0124936DA5B7FEC8",sub(Str1,X,1)),1)


Edits:
1. fixed topmost code
2. added bottom 2 code blocks
3. changed a [/size] tag into the correct [/code] tag
4. added this edit track.
5. compressed topmost code
stop putting unnecessary end parentheses. You should always close For( and only For(
And always put a Then after an If unless it is a Goto. Even if it is just one line, it goes faster with a Then.
Will_W wrote:
stop putting unnecessary end parentheses. You should always close For( and only For(
And always put a Then after an If unless it is a Goto. Even if it is just one line, it goes faster with a Then.


Why close For( ? I meaqn, if you're not gonna close anything else, why close For(
Because stuff inside unclosed For( runs slower due to some unknown fail within the interpretor.
@Will_W: Ya happy?

@Everyone: Final update (I think):

Code:
::"Icon Editor for the 83+
::"7FF0411057105450567052505E48404440687FF4000CEEE948AD48AB48A9EEE9
:Lbl ST
:ClrDraw
:PlotsOff
:FnOff
:AxesOff
:For(A,0,62)
:Pxl-On(A,0
:Pxl-On(A,64
:End
:For(A,1,63)
:For(B,4,63,4)
:Pxl-On(A-1,B
:Pxl-On(B-1,A
:End
:End
:Text(0,66,"[CLEAR]"
:Text(6,77,"=Quit"
:Text(31,66,"[DEL]="
:Text(37,83,"Clr")
:For(B,94,78,-1)
:Pxl-On(56,B
:End:Pxl-Off(56,77
:For(A,57,62)
:Pxl-On(A,77
:End
:Text(57,79,"Save"
:1→C:1→D
:Lbl Z
:Repeat 0
:Delvar KPxl-Change(4C-2,4D-1
:Pxl-Change(4C-4,4D-1
:Pxl-Change(4C-2,4D-3
:Pxl-Change(4C-4,4D-3
:Repeat iPart(K/10)=2 or K=15 or K=34 or iPart(K/10)=4
:getKey→K
:End
:If K=22:Goto M1
:If K≥42 and K≤44
:Then
:{16,16→dim([A]
:For(A,1,16)
:4A-3→Y
:For(B,1,16)
:Pxl-Off(A+13,B+70
:pxl-Test(Y,4B-1→[A](A,B
:Pxl-Change(Y,4B-2
:End:End
:End
:If K=43 or K=44
:Then
:For(Z,1,8)
:rowSwap([A],Z,17-Z→[A]
:End
:End
:If K=42 or K=44
:Then
:[A]{^T}→[A]
:For(Z,1,8)
:rowSwap([A],Z,17-Z→[A]
:End
:[A]{^T}→[A]
:End
:If K≥42 and K≤44
:Then
:For(A,1,16)
:For(B,1,16)
:If [A](A,B
:Then
:For(E,4A-4,4A-2)
:For(F,4B-3,4B-1)
:Pxl-On(E,F
:End:End
:Pxl-On(A+13,B+70
:Else
:For(E,4A-4,4A-2)
:For(F,4B-3,4B-1)
:Pxl-Off(E,F
:End:End
:Pxl-Off(A+13,B+70
:End
:End
:End
:End
:If K=41
:Then
:For(A,1,16)
:For(B,1,16)
:For(E,4A-4,4A-2)
:For(F,4B-3,4B-1)
:Pxl-Change(E,F
:End:End
:Pxl-Change(A+13,B+70
:End:End
:End
:If K≥24 and K≤26 or K=34 or K=41
:Then
:Pxl-Change(4C-2,4D-1)
:Pxl-Change(4C-2,4D-3)
:Pxl-Change(4C-4,4D-1)
:Pxl-Change(4C-4,4D-3)
:End
:D-(K=24 and D≠1)+(K=26 and D≠16)→D
:C-(K=25 and C≠1)+(K=34 and C≠16)→C
:If K=21
:Then
:Pxl-Change(4C-2,4D-2
:Pxl-Change(4C-3,4D-1
:Pxl-Change(4C-3,4D-2
:Pxl-Change(4C-3,4D-3
:Pxl-Change(4C-4,4D-2
:Pxl-Change(C+13,D+70
:End
:If K=23:Goto ST
:If K=15:Goto SA
:If K=45:Goto Q
:End
:End
:Lbl M1
:Pxl-Change(4C-2,4D-1
:Pxl-Change(4C-2,4D-3
:Pxl-Change(4C-4,4D-1
:Pxl-Change(4C-4,4D-3
:Lbl M
:Menu("Recall what?    ","Kerm's Icons",KI,"Yarnot Icons",YI,"Last Icon made",LI,"...Back",Z
:Lbl KI
:Menu("Recall what? (K)","Folder icon",FI,"BASIC prog icon",BI,"ASM prog icon",AI,"ION prog icon",II,"DCS prog icon",DI,"...Back",M
:Lbl YI
:Menu("Recall what? (Y)","Group icon",GI,"Flash App icon",FA,"...Back",M
:Lbl LI
:0:Asm(prgmSTREXIST
:If Ans=1:Then
:If length(Str0)≥66:Then
:For(X,3,66)
:If inString("0123456789ABCDEF",sub(Str0,X,1))=0:Goto Z
:End
:sub(Str0,3,64→Str3:End
:Else:Goto Z
:End:
:Goto Y
:Lbl FI
:"000038F04708801C80E2870288045004500450045008503033C03C0000000000→Str3
:Goto Y
:Lbl BI
:"C000A000E6D392849654E6D300000004FB86A93F2106738400337F4A00490033→Str3
:Goto Y
:Lbl AI
:"200050005368FA5489548B5400000004FB86A93F2106738400337F4A00490033→Str3
:Goto Y
:Lbl II
:"7DD2822D6EAD2AA52AA96EAD822D7DD200000006380B5C2F8EA6DE80FEA67C2B→Str3
:Goto Y
:Lbl DI
:"7FD27FD54FD543C941C041D141D145D141CE41C041CE31110D11031F00000000→Str3
:Goto Y
:Lbl GI
:"38F04708801C80E28702880455545FFC5AAC500851F036003B66045505660354→Str3
:Goto Y
:Lbl FA
:"1000299829547D984510451200000004FB86A93F2106738400337F4A00490033→Str3
:Lbl Y
:" "→Str4
:For(X,1,64)
:Str4+sub("0000100110101111000",inString("0124936DA5B7FEC8",sub(Str3,X,1)),4→Str4
:For(Y,16fPart(X/4)+1,16fPart(X/4)+4)
:Pxl-Change(4iPart(X/4)+1,4Y-2
:Pxl-Off(iPart(X/4)+14,Y+70
:End
:End
:For(X,1,16)
:For(Y,1,16)
:For(U,4X-3,4X-1)
:For(V,4Y-3,4Y-1)
:If sub(Str4,Y+16X-16)="1"
:Then:Pxl-On(U,V)
:Else:Pxl-Off(U,V)
:End
:End:End
:If sub(Str4,Y+16X-16)="1":Pxl-On(Y+13,X+70)
:End:End
:Goto Z
:Lbl SA
:Text(46,85,"I%
:Text(46,85,"   
:":→Str1
:For(C,1,16)
:4C-3→Y
:For(D,1,16)
:Str1+sub("01",pxl-Test(Y,4D-1)+1),1→Str1
:Pxl-Change(4C-3,4D-2
:If int(50length(Str1)/256)=0
:Then
:Text(46,85,0
:Else
:Text(46,85-4iPart(log(50length(Str1)/256)),int(50(length(Str1)/256
:End
:End:End
:sub(Str1,2,length(Str1)-1→Str1
:":→Str0
:For(X,1,length(Str1),4)
:Text(46,85-4iPart(log(50(X/255)+50)),int(50(X/255)+50
:Str0+sub("0124936DA5B7FEC8",inString("0000100110101111000",sub(Str1,X,4)),1→Str0
:End
:sub(Str0,2,length(Str0)-1→Str0
:"AsmPrgm:"+Str0+"49636F6E2046696C6500C9→Str0
:Text(46,77,100
:Pause
:Lbl Q
:ClrDraw
:ClrHome
:Output(1,1,"
Xeno_Cre8or wrote:
I didn't know if the other one would work, because it looks like it treats a binary number as a decimal one.

That's the idea. Let me write out the congruences:

Code:
:0 ≡ 0 (mod 16)     //0
:1 ≡ 1 (mod 16)     //1
:10 ≡ 10 (mod 16)   //A
:11 ≡ 11 (mod 16)   //B
:100 ≡ 4 (mod 16)   //4
:101 ≡ 5 (mod 16)   //5
:110 ≡ 14 (mod 16)  //E
:111 ≡ 15 (mod 16)  //F
:1000 ≡ 8 (mod 16)  //8
:1001 ≡ 9 (mod 16)  //9
:1010 ≡ 2 (mod 16)  //2
:1011 ≡ 3 (mod 16)  //3
:1100 ≡ 12 (mod 16) //C
:1101 ≡ 13 (mod 16) //D
:1110 ≡ 6 (mod 16)  //6
:1111 ≡ 7 (mod 16)  //7

All in base ten on the left hand side.

And, I'd call optimizing the code far from over...

What the hell. I have some free time to waste.
Just a general point of interest, when you have something like this:
Code:
Repeat iPart(K/10)=2 or K=15 or K=34 or iPart(K/10)=4
you can usually flip things around to save a parenthesis:
Code:
Repeat iPart(K/10)=2 or K=15 or K=34 or 4=iPart(K/10
Edit: Also, .1K is one byte smaller than K/10:
Code:
Repeat iPart(.1K)=2 or K=15 or K=34 or 4=iPart(.1K
KermMartian wrote:
Just a general point of interest, when you have something like this:
Code:
Repeat iPart(K/10)=2 or K=15 or K=34 or iPart(K/10)=4
you can usually flip things around to save a parenthesis:
Code:
Repeat iPart(K/10)=2 or K=15 or K=34 or 4=iPart(K/10
Edit: Also, .1K is one byte smaller than K/10:
Code:
Repeat iPart(.1K)=2 or K=15 or K=34 or 4=iPart(.1K


You see, I may be a self-made expert in getting BASIC to do what you want, but not in optimizing it afterward. Like most people, before this post, probably didn't know that the "SetUpEditor" command unarchives the lists in the event that they're archived.
Starting with one of these (equal) window settings (ordered by size) should make working with the DRAW functions a snap:

Code:
0→Xmin:94→Xmax
0→Ymin:62→Ymax

0→Xmin:1→ΔX
0→Ymin:1→ΔY

ZStandard
84→Xmin
52→Ymin
ZInteger


For instance, this

Code:
:For(A,0,62)
:Pxl-On(A,0
:Pxl-On(A,64
:End
:For(A,1,63)
:For(B,4,63,4)
:Pxl-On(A-1,B
:Pxl-On(B-1,A
:End
:End

...now becomes this:

Code:
:For(A,-1,64,4
:Vertical X+1
:Line(0,X,64,X
:End


And this

Code:
:For(B,94,78,-1)
:Pxl-On(56,B
:End:Pxl-Off(56,77
:For(A,57,62)
:Pxl-On(A,77
:End

...turns into this:

Code:
:Line(77,0,77,5
:Line(78,6,94,6


Hopefully, this will give you an idea of how to make your programs run faster. Unfortunately, there's no Pxl-Change()-analogue for lines, but you are able to use a fifth "Boolean" argument for Line() to turn pixels off.

I'll ignore the fact that you kept the "If int(50length(..." bit the same way as it was before.

Oh, and:


Code:
:K=15 or K=34 or 1=abs(3-int(.1K
Weregoose wrote:
I'll ignore the fact that you kept the "If int(50length(..." bit the same way as it was before.


Please don't. What's the problem?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement