So what I have is a square that will stamp itself in a grid across the screen. The fancy thing is, the square changes costumes every time to 'render' a picture.
It does this by using a 180 character code in a variable, where each number represents a costume. A script transfers each number into a new item in a list.
My problem is that I want people to be able to share their codes so that they can render each others creations. This is a bit of a problem as it would require 180 numbers to be typed out.
My idea was that I could divide the large number by 20, and then when I wanted to render it it would just multiply it by 20. This became a problem because the numbers 1, 2, 3, 4 don't divide that well. My idea was to make the costume names 20, 40, 60, etc.
Scratch decided that the costume names have to be 21, 41, 61 etc. etc. and is really frustrating.
Does anyone have any better ideas on how to make the number smaller or how to fix the costume names?
Here is the project with a direct download from my dropbox:
https://dl.dropbox.com/u/35308512/rende … e%20wip.sb
Offline
Okay, 180 characters. I'm assuming they're digits between 0 and 9. There's no real way to compress something like that. There are simple "loss-less" compression techniques that take into account consecutive digits, but that doesn't guarantee a smaller size. Check out this Wikipedia article.
Dividing by a number won't do the trick, since you'd still end up with decimal places at the end. And dividing by 20 would reduce the size of the number by only 2 digits at most.
You could display the data in a list and allow the user to copy/paste.
Offline
http://en.wikipedia.org/wiki/Run-length_encoding might be of some interest too.
Offline
satire, please make sure your posts are helpful and not pointless. pointless messages are considered to be spam. (and btw hash tags don't work on fora)
I can't download the project right now, but I'm assuming your 180 characters are digits. if not, I can't help you.
but you should convert 0-29 to 0-9 and a-t so you have 30 digits in thirty-nary. I'm not sure exactly how it will work, but using a single character for a larger number may help
Offline
kayybee wrote:
I can't download the project right now, but I'm assuming your 180 characters are digits. if not, I can't help you.
but you should convert 0-29 to 0-9 and a-t so you have 30 digits in thirty-nary. I'm not sure exactly how it will work, but using a single character for a larger number may help
yes, they are digits. So far they are only 4 costumes.
Offline