Discuss Scratch

djdolphin
Scratcher
1000+ posts

[ATC#8] Harold


ATC#8: Harold



Template Project


Harold has somehow become trapped inside Scratch, and he has no idea how to get out. To help him escape, write a project that exports the image of Harold as a data url in the image format of your choice. The image is stored in the template project as a list of colors, named “harold colors”.

The sprite named “magic” contains blocks for writing integers, text, etc. to lists as individual bits, as well as a block to convert those bits to a data url. Those might help.

Please tell me if you find any problems in the template project.

Specific Rules
- Your project must work for any image.
- Your project must use the “harold colors” list to generate the url.
- The exported image must display correctly in the latest version of at least one major browser (Chrome, Firefox, Edge, or Safari).
- No extensions (except to console.log the resulting url, or something similar).
- No mods.
- No cloud data.
- Seriously, just write it in Scratch.
- Anything else is fair game.

Scoring
- Once the deadline (TBD) is reached, the project that produces the smallest image wins.
- Any HTTP requests made by the generated data url are included in the file size.
- Harold would greatly prefer if he isn't even more damaged once exported. (1,000,000x penalty for lossy compression).

Stuff That Might Help
Google

Last edited by djdolphin (Sept. 17, 2016 14:27:44)


!
TheMonsterOfTheDeep
Scratcher
1000+ posts

[ATC#8] Harold

Sounds interesting! I've never done any image encoding before, although I've really been meaning to get around to it.

my latest extension: 2d vector math
TheMonsterOfTheDeep
Scratcher
1000+ posts

[ATC#8] Harold

So, wait - what's to stop me from simply compressing the image with some great png compressor, and display that? Is that fair game?

my latest extension: 2d vector math
CodeLegend_test
Scratcher
11 posts

[ATC#8] Harold

TheMonsterOfTheDeep wrote:

So, wait - what's to stop me from simply compressing the image with some great png compressor, and display that? Is that fair game?

djdolphin wrote:

Seriously, just write it in Scratch.

MartinBraendli wrote:

This is a puzzle for coders, not lawyers. The goal is not to find legal loop holes, but to program with a limited selection of blocks.
TheMonsterOfTheDeep
Scratcher
1000+ posts

[ATC#8] Harold

CodeLegend_test wrote:

MartinBraendli wrote:

This is a puzzle for coders, not lawyers. The goal is not to find legal loop holes, but to program with a limited selection of blocks.
Well yes, I know - but it seems to me that that is *not* actually a loophole - it's the first idea I had when considering this puzzle, as pre-compressing images is the best way to compress images.

I wouldn't do that, of course, because that's no fun, but something about the fact that that solution exists makes this seem less fun for me.

my latest extension: 2d vector math
djdolphin
Scratcher
1000+ posts

[ATC#8] Harold

TheMonsterOfTheDeep wrote:

I wouldn't do that, of course, because that's no fun, but something about the fact that that solution exists makes this seem less fun for me.
I don't see how you could consider that a solution. Once you run the image through an external compressor, it's no longer fully produced by your project.

!
comp09
Scratcher
1000+ posts

[ATC#8] Harold

I think I just made a working solution, but the result freezes Scratch when I try to display it in a list…

Now how does Harold escape?

Last edited by comp09 (Sept. 17, 2016 03:17:33)



Visit the website of Andrew Sun!


djdolphin
Scratcher
1000+ posts

[ATC#8] Harold

comp09 wrote:

I think I just made a working solution, but the result freezes Scratch when I try to display it in a list…
Maybe I'll allow using an extension to console.log the url then.

!
liam48D
Scratcher
1000+ posts

[ATC#8] Harold

djdolphin wrote:

comp09 wrote:

I think I just made a working solution, but the result freezes Scratch when I try to display it in a list…
Maybe I'll allow using an extension to console.log the url then.
Or better, prompt-default the URL (“prompt('get url:', dataURL)”) or open a popup window

202e-202e-202e-202e-202e UNI-CODE~~~~~
comp09
Scratcher
1000+ posts

[ATC#8] Harold

My solution: https://scratch.mit.edu/projects/121563019/ (it displays, eventually)


Visit the website of Andrew Sun!


Jonathan50
Scratcher
1000+ posts

[ATC#8] Harold

Lol most of the images I get when I search Google Images for “harold” are the same

Not yet a Knight of the Mu Calculus.
djdolphin
Scratcher
1000+ posts

[ATC#8] Harold

comp09 wrote:

My solution: https://scratch.mit.edu/projects/121563019/ (it displays, eventually)
… I didn't expect a CSS solution.

!
CodeLegend_test
Scratcher
11 posts

[ATC#8] Harold

djdolphin wrote:

TheMonsterOfTheDeep wrote:

I wouldn't do that, of course, because that's no fun, but something about the fact that that solution exists makes this seem less fun for me.
I don't see how you could consider that a solution. Once you run the image through an external compressor, it's no longer fully produced by your project.
Maybe you should specify that it must work for any image?
djdolphin
Scratcher
1000+ posts

[ATC#8] Harold

CodeLegend_test wrote:

Maybe you should specify that it must work for any image?
Done.

!
CodeLegend_test
Scratcher
11 posts

[ATC#8] Harold

djdolphin wrote:

CodeLegend_test wrote:

Maybe you should specify that it must work for any image?
Done.
Wow, that was fast. I was about to say EDIT: Oh nevermind, you've already done it…
TheUltimatum
Scratcher
1000+ posts

[ATC#8] Harold

Interesting challenge. I'll shall attempt my best.
Zro716
Scratcher
1000+ posts

[ATC#8] Harold

https://scratch.mit.edu/projects/121571610/

As a long time Scratcher, I have found new meaning to the name “Scratch”: for me, it means to “scratch that itch”, to come back again and again to realize new ideas in this toy language, even when I'm capable of creating my projects in real programming languages years later. It's a friend that helped me to pursue programming and get me to enjoy its fruit. I'm certain many others who have walked this path as well have grown fond of its importance in their life.
dzaima
Scratcher
100+ posts

[ATC#8] Harold

oh. Didn't notice this got made. But looks like other people have done this already
Nor do I have an idea how to do this.

HELLo there
comp09
Scratcher
1000+ posts

[ATC#8] Harold

liam48D
Scratcher
1000+ posts

[ATC#8] Harold

https://scratch.mit.edu/projects/121591946/

202e-202e-202e-202e-202e UNI-CODE~~~~~

Powered by DjangoBB