The formula for finding the hexcodes that the sprite program Hexsprite uses (the one that comes packaged with Axe) is this:


Code:

" ->Str1
"0123456789ABCDEF->Str2
For(A,N,N+7
For(B,B,B+7
0->T
3->P
For(C,B,B+3
T+2^Ppxltest(A,C->T
End
Str1+sub(Str2,T+1,1->Str1
End
End


I am not able to recreate this with Axe. Any ideas?
Can you explain what you are trying to do?
Most of the time, porting BASIC directly to axe doesn't result in the best code possible.

Edit: so i assume you want to convert an 8*8 image to its hexadecimal representation. If you are creating an image editor, i would recommend storing the image separately in ram, and drawing it onto the screen with the sprite command.
Anyways, if you have an 8*8 image, packed into 8 bytes, converting it into a hexadecimal string would look something like:

Code:

ClearHome
ImagePointer-1->I
L1-1->P
For(8)
{I+1->I}->A and 15+'0'->{P++}
A/16+'0'->{P++}
End
0->{L1+16}

And now the hex string is in L1.
Runer could probably make it better >.<

Edit 2:
BTW, is this how you are supposed to use Select runer112?

Code:

ClearHome
ImagePointer-1->I
L1-1->P
For(8)
Select({I+1->I}, and 15+'0'>{P++})/16+'0'->{P++}
End
0->{L1+16}

If so, this is smaller.
  
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