This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-07 00:12:42

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Glitch in binary to image converter

MY friend and I have created a binary to image converter, however we are encountering some glitches. If anyone could take a look at our code and tell us what's wrong, the project is here. Our binary creeper face has been encountering problems as of the digit after the last one in the notes.


........................................................................................................................................................................................................................................

Offline

 

#2 2012-06-07 00:43:26

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Glitch in binary to image converter

What are you trying to achieve with that project? As in, how does changing which number in which digits place affect the picture?

Offline

 

#3 2012-06-07 00:46:28

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: Glitch in binary to image converter

Basically, It fills in pixels that are the sum of your numbers binary. 7815070542830079 Is the number for our creeper face, for example. When we try to add the next number, which we have been doing the whole time (the number is 18,014,398,509,481,984), it glitches out and makes a deformed version of it.


........................................................................................................................................................................................................................................

Offline

 

#4 2012-06-07 00:52:30

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Glitch in binary to image converter

I think Scratch doesn't handle that many digits.

If you're trying to make something that draws a picture based on a number that you give (I still don't understand it with the binary and all), I suggest you make an encoder. You would draw your picture by having the sprite you use fit in a grid and stamp when the mouse is down. It would take it's coordinates and store it in lists. Then when the person presses the ending key or a button is pushed, the program encodes all the x position and y positions into the type of coding that you want and redraws the picture to make sure it got it right. Then you would also have the decoder, the one you have right now.

I'm not sure how that paragraph solves your problem if it's Scratch not handling the number... but on the off-chance that Scratch handles that number that plan above is a good choice.

Last edited by TorbyFork234 (2012-06-07 00:53:07)

Offline

 

#5 2012-06-07 00:56:29

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: Glitch in binary to image converter

Were not trying to get it to redraw something. Its supposed to render an image based on the binary. Basically, you add an exponent of 2, and it renders all the exponents of 2 in your number added together. So you add up the powers of 2 you want to get your image  wink


........................................................................................................................................................................................................................................

Offline

 

#6 2012-06-07 00:57:40

legosarefun
Scratcher
Registered: 2011-03-28
Posts: 9

Re: Glitch in binary to image converter

The problem is we want an end all be all script so no mater what number we put in it creates some sort of pixelated design.

Offline

 

#7 2012-06-07 01:01:37

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Glitch in binary to image converter

zubblewu wrote:

Were not trying to get it to redraw something. Its supposed to render an image based on the binary. Basically, you add an exponent of 2, and it renders all the exponents of 2 in your number added together. So you add up the powers of 2 you want to get your image  wink

Yes, I know that, but it would be much simpler if you create an encoder that you would be able to draw it for you and tell you the number so you now have the number you need.
You said you saw my array-based raycaster. Do you think I put in those over one hundred 1's and 0's per line? I set the computer to do it. Then, realizing I had built something awesome, I made a project about it which is now the Create your Own Array Based Raycaster one.
Create the encoder, stamp your picture, and get the computer to get you the number instead of working it out with your friend for over an hour.

Offline

 

#8 2012-06-07 01:09:17

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: Glitch in binary to image converter

But i'm not sure scratch could make the number in a variable without it being preset-as in by an answer. I guess I could try.


........................................................................................................................................................................................................................................

Offline

 

#9 2012-06-07 01:09:21

legosarefuntest
New Scratcher
Registered: 2012-06-07
Posts: 1

Re: Glitch in binary to image converter

We just want help with getting the variables to work the creeper face was just something extra we were doing with this.

Offline

 

#10 2012-06-07 01:12:14

legosarefun
Scratcher
Registered: 2011-03-28
Posts: 9

Re: Glitch in binary to image converter

Why did I change to my test account DErP!

Offline

 

#11 2012-06-07 01:17:04

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Glitch in binary to image converter

legosarefuntest wrote:

We just want help with getting the variables to work the creeper face was just something extra we were doing with this.

And this is the only help I could think of besides for spending the hours you've have trying to figure out the correct number for your creeper face.

zubblewu wrote:

But i'm not sure scratch could make the number in a variable without it being preset-as in by an answer. I guess I could try.

I'm assuming your saying how variables automatically round their numbers to the nearest tenth but there is a way to get out of that. You would have to do a lot of
join (letter (1,2,3,4,etc...) of (your variable) to show the whole variable that's stored into it. Variables keep the whole value that you give to it, but Scratch just displays it rounded to the nearest tenth.

Offline

 

Board footer