BASIC Code wrote:
:Input ("SPRITE SIZE-",Z
:DelVar LDelVar XDelVar Y
:While Y<Z
:DelVar CIf pxl-Test(Y,X
:C+8→C
:If pxl-Test(Y,X+1
:C+4→C
:If pxl-Test(Y,X+2
:C+2→C
:If pxl-Test(Y,X+3
:C+1→C
:"0123456789
:If C≤9
:sub(Ans,C+1,1→Str1
:If C>9
:Then
:1→I
:{10,11,12,13,14,15→∟LOL
:While C≠∟LOL(I
:I+1→I
:End
:"ABCDEF
:sub(Ans,I,1
:End
:If L
:Then
:Str4+Ans→Str4
:Else
:Ans→Str4
:1→L
:End
:X+4→X
:Y+(X≥Z→Y
:If X≥Z
:DelVar XEnd
:Str4
Generated by SourceCoder, © 2005 Cemetech



Basically....
It takes a sprite of whatever size from the top left corner of the graph screen, then it stores the hex in Str4 and displays Str4.
quickie optimizations

Quote:
Input ("SPRITE SIZE-",Z
:DelVar LDelVar XDelVar Y
:While Y<Z
:DelVar C
:For(N,0,3
:if pxlTest(Y,X+N
:C+2^(3-N -->C
:End

:"0123456789
:If C≤9
:sub(Ans,C+1,1→Str1
:If C>9
:Then
:1→I
:{10,11,12,13,14,15→∟0x5
:While C≠∟0x5(I
:I+1→I
:End
:sub("ABCDEF",I,1
:End
:If L
:Then
:Str4+Ans→Str4
:Else
:Ans→Str4
:1→L
:End
:X+4→X
:Y+(X≥Z→Y
:If X≥Z
:DelVar XEnd
:Str4
Thanks a bunch Very Happy
Hmm.. I don't remember the section of code I had that did that for me, but of course it was for a specific spot on the screen, with in the 8x8, 16x16 or 32x32 box.

BASIC Code wrote:


.......

:If K=11:Then
Razzt-Off(M,N
:RecallPic Pic4
:If Z=8:Then
:41→S:48→T
:24→Q:31→R
:End
:If Z=16:Then
:37→S:52→T
:20→Q:35→R
:End
:If Z=32:Then
:29→S:60→T
:12→Q:43→R
:End
:For(A,Q,R
:For(B,S,T,4
:8pxl-Test(A,B)+4pxl-Test(A,B+1)+2pxl-Test(A,B+2)+pxl-Test(A,B+3)→C
:Pxl-On(A,B
:If C=0:Str1+"0"→Str1
:If C>0
:Str1+sub("123456789ABCDEF",C,1)→Str1
:End:End
:sub(Str1,2,length(Str1)-1)→Str4
:DelVar Str1
:ClrDraw
:Text(0,0,"YOUR SPRITE HAS BEEN
:Text(6,0,"CONVERTED, PASTE Str4
:Text(12,0,"INTO A PROGRAM TO USE
:Pause
:0→W
:End
Generated by SourceCoder, © 2005 Cemetech


That sets the size of the box and then goes through and converts the sprite to hex. Been a while since I have even looked at all this code.. ><

oh yeah, program is at: http://www.ticalc.org/archives/files/fileinfo/389/38904.html
Of course, mine isn't as advanced as yours.. Razz
lol, I know XD

Just pointing it out, to see if you can make yours better without blatantly copying. =p
Couldnt find a not equal to sign so I used #
Used -> as store.W prompt is width, H is height,
X is the X starting point, Y is the Y starting point.
Stores hex to Str1

:ClrDraw
:CrlHome
:" ->Str1
:Delvar ADelvar
BDelvar CPrompt
W,H,X,Y
:W-1->W
:RecallPic 7
:Repeat Y=H
:C+(C#4)-(C=4->C

:pxl-Test(Y,X->L1
(C
:If C=4
:Str1+sub("01234
56789ABCDEF",sum
(seq(L1(X)*2^(4-
X),X,1,4))+1,1->S
tr1
:Y+(X=W->Y
:X+(X#W)-X(X=W->X

:End
:ClrHome


BEAT THAT!!!
xenonparadox wrote:
Couldnt find a not equal to sign so I used #
Used -> as store.W prompt is width, H is height,
X is the X starting point, Y is the Y starting point.
Stores hex to Str1
[...]


Hmm, not too horrible. I was able to come up with only a few things:

Code:
:ClrDraw
:CrlHome
:" ->Str1
:Delvar ADelvar BDelvar CPrompt W,H,X,Y
:W-1->W
:RecallPic 7
:Repeat Y=H
:C-1+2*(C≠4->C
:pxl-Test(Y,X->L1(C
:If C=4
:Str1+sub("0123456789ABCDEF",sum(seq(L1(X)*2^(4-X),X,1,4))+1,1->Str1
:Y+(X=W->Y
:X+(X≠W)-X(X=W->X
:End
:ClrHome
bahahaha


Code:
:ClrDraw
:CrlHome
:" ->Str1
:Delvar ADelvar BDelvar CPrompt W,H,X,Y
:W-1->W
:RecallPic 7
:Repeat Y=H
:C-1+2(C≠4->C
:pxl-Test(Y,X->L1(C
:If C=4
:Str1+sub("0123456789ABCDEF",sum(seq(L1(X)*2^(4-X),X,1,4))+1,1->Str1
:Y+(X=W->Y
:X+(X≠W)-X(X=W->X
:End
:ClrHome
That was an implicit multiplication, rthprog. I was assuming he would realize that and making it explicit for the purposes of display. Razz

Code:
:Str1+sub("0123456789ABCDEF",sum(seq(L1(X)*2^(4-X),X,1,4))+1,1->Str1

to

Code:
:Str1+sub("0123456789ABCDEF",sum(seq(L1(X)2^(4-X),X,1,4))+1,1->Str1


?

Code:

:ClrHome
:ClrDraw
:Prompt W,H,X,Y
:RecallPic 7
:"?
:For(A,X+W-1
:For(B,Y+H-1,4
:Ans+sub("0123456789ABCDEF",1+8pxl-test(A,B)+4pxl-test(A,B+1)+2pxl-test(A,B+2)+pxl-test(A,B+3),1
:End:End
:sub(Ans,2,length(Ans)-1→Str1
  
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 1
» 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