Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » [ATC#8] Harold
- djdolphin
- Scratcher
1000+ posts
[ATC#8] Harold
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
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
So, wait - what's to stop me from simply compressing the image with some great png compressor, and display that? Is that fair game?
Seriously, just write it in Scratch.
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
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.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.
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
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. 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.
!
- 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?
Now how does Harold escape?
Last edited by comp09 (Sept. 17, 2016 03:17:33)
- djdolphin
- Scratcher
1000+ posts
[ATC#8] Harold
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. I
!
- liam48D
- Scratcher
1000+ posts
[ATC#8] Harold
Or better, prompt-default the URL (“prompt('get url:', dataURL)”) or open a popup windowthink 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. I
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)
- 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
https://scratch.mit.edu/projects/121563019/ (it displays, eventually)… I didn't expect a CSS solution. My solution:
!
- CodeLegend_test
- Scratcher
11 posts
[ATC#8] Harold
Maybe you should specify that it must work for any image?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. 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.
- djdolphin
- Scratcher
1000+ posts
[ATC#8] Harold
Done. Maybe you should specify that it must work for any image?
!
- CodeLegend_test
- Scratcher
11 posts
[ATC#8] Harold
Wow, that was fast. I was about to say EDIT: Oh nevermind, you've already done it…Done. Maybe you should specify that it must work for any image?
- TheUltimatum
- Scratcher
1000+ posts
[ATC#8] Harold
Interesting challenge. I'll shall attempt my best.
- Zro716
- Scratcher
1000+ posts
[ATC#8] Harold
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.
- Discussion Forums
- » Advanced Topics
- » [ATC#8] Harold