Skylite's Icon Creator Suite originally just generated hex code, but now also installs the code into the program of your choice. It can import icons from pictures, PicArc libraries, and strings, and export them as the same. It is actually nearly 100% DCSB libs, especially the GUI ones!

To start with, does anyone know of a way to turn "1010" into "A", or do the same thing for "1010001000001110"?
There may be a strange (tricky) way to do it, but I'd stick with the mathematical definition of the problem.

A number x in base n is a string of characters, where the value of the digit at position i (where position 0 is the least significant digit) represents a multiple of n^i. The overall value is the sum of all the digits.

Considering "1010" in binary, that's (0*2^0) + (1*2^1) + (0*2^2) + (1*2^3), or 10 in decimal, which we represent as "A" in hex. How to do such a thing in code? Here's a first go: (my TI-BASIC is very rusty, so this may not actually be quite right)
Code:
:"1010"→Str1
:StrLen(Str1)→L
:0→X
:For(J,0,L-1)
:X+2^J*(sub(Str1,L-J,1)="1")→X
:End
This gets you the value of the binary string in X. Converting to hex, it's easiest just to use a lookup table:
Code:
:sub("0123456789ABCDEF",X+1,1)→Str1
So then you have converted 4 binary digits to hex in a string.

If you want to do this for a longer string, it's easiest just to take the binary digits four at a time, and do the same conversion, concatenating the results as you go.
Thank you very much, Tari! A pre-release will be coming soon, but next - does anyone know how to convert "1" to 1? String to decimal? And I can use DCSB libs too.
Thanks!
Look for something like "expr(" I know that works on TI-83/84, but I'm not sure what you're using. (If you are using those calcs, then I'm pretty sure StrLen above should be "length(")
About "length(", you are dead right, that is what it is. About "expr(", I dunno how I would use that. I am using an 84 PSE.
http://www.ticalc.org/archives/files/fileinfo/385/38508.html Might be something close to what you are looking for or wanting to do? It converts binary to hex for sprites of 8x8, 16x16, and 32x32 sizes.
tifreak8x wrote:
http://www.ticalc.org/archives/files/fileinfo/385/38508.html Might be something close to what you are looking for or wanting to do? It converts binary to hex for sprites of 8x8, 16x16, and 32x32 sizes.


Hex to Sprite? How would that help me if I need (really) sprite to hex?
CalebHansberry wrote:
About "length(", you are dead right, that is what it is. About "expr(", I dunno how I would use that. I am using an 84 PSE.
Sounds like there's a certain book I know of that might help. Wink expr(string) takes string and interprets it as math. For example, the following displays 1337:


Code:
:37->A
:Disp expr("A+1000")


This example doesn't put it to good use, but it helps to optimize code that would other have a lot of branches for particular bits of math.
Oh! I get "expr(" now. I just use "expr(sub(Str0,2,1)" to extract a value from the string Doors leaves behind for radio-buttons.

Skylites Icon Suite BETA has been released in the Cemetech archives now! Yay! Kerm, you really should try it, because it uses so many DCSB libs that it could be an advertisement.
I just threw it onto jsTIfied and gave it a test, and I must say that I'm quite impressed! Great job on this, including your use of the DCS libs and Input for sprite-drawing. I also made sure it properly complains when Doors CS 7 is not installed, which it does. I have added a link to it on the BASIC Header page of the Doors CS wiki for now, and might link elsewhere at a later date.
Oh, thanks, Kerm!

OK everyone! Skylites' Icon Suite Beta 2 has been released! It adds support for DCS descriptions, DCS5 icons, and converts the icon to hexadecimal faster thanks to using TIFreak's code (thank you!), is spiffed a little, the included PicArc database is half the size, and more!


And I am very happy to have finally conquered my in ability to use hybrid TI-Basic to insert a " into a program! I used sub( to rip a " ripped from a program (which conveniently is itself) with CelticIII's LineRead library. That is how it now can insert DCS descriptions, which use a quote.

And please, please remember, this is a prerelease! I need help with you guys using/abusing this program and helping find annoying bugs or things that could be improved! By the way, if anyone wants to make a French version, I would be glad of that too...

I suppose Kerm should update that link.

[EDIT] And in this version, I made it so that the cursor for drawing the icon no longer goes down a pixel every time you toggle a pixel! For both that fix, and the usage of Input for drawing the icon, kudos go to Kerm. I learned both tricks from reading - pretty much all of - CivSimI, an excellent TI-Basic program.
That looks really nice, Caleb! I would have killed for a fast application like this about three years ago. The icon generators have always been on the clunky side, but from the looks of it, you're remedying that quite well.
Kaslai wrote:
That looks really nice, Caleb! I would have killed for a fast application like this about three years ago. The icon generators have always been on the clunky side, but from the looks of it, you're remedying that quite well.


Thank you very much for the kind words!

And yes, I personally find it a joy to use SIS to start any project with an icon.
I continue to be happy with your use of Doors CS's GUI features for BASIC programmers plus the Celtic III libraries. I'm glad you seem to be understanding the nuances of the APIs fairly well from the existing documentation, and I hope that this program proves useful to many coders.
Okay everyone, just wanted to say that there had been a problem with the archive queue, and SIS beta 2 has only just now been made available.

So with that being said, I re-announce - Skylites Icon Suite Beta 2! Anyone who get use out of SISB or would like to, I strongly encourage to download the new version, as it makes the system much more useful and intuitive, and repairs many features that didn't work right.

Again, please, please remember, this is a prerelease! I need help with you guys using/abusing this program and helping find annoying bugs or things that could be improved! And if anyone wants to make a French version, I would be glad of that too.
[bump] This is still being developed! And, 16 downloads with folks still downloading the old version - I'd recommend you folks download it if you haven't already! Plus, it has still never been rated; someone might do that. And I'll need bug reports/suggestions.
  
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