Black Square Puzzle - Instructions on Screen **Full Screen essential (very hard to solve otherwise)** 5 Shapes almost fill the Puzzle Frame. Can you fit the Black Square in too? Your task is to find a way! For high precision placement (after moving the big Shape) a compass with arrows appears on-screen. Use the arrows (or Keyboard arrows) to move the selected Shape 1 pixel in the chosen direction. If a Shape is already correctly placed an arrow move will be undone if it touches another Shape or the Frame. * New Feature * : Added June 2022 thanks to a suggestion by @colinmacc. When trying to place a Shape with the Precision Placement arrows (keyboard or on-screen), if a move gets the Shape within 1 or 2 pixels of being correctly placed, it will snap into place. ** Why Full Screen is essential **: It is very difficult to solve the puzzle in Normal Screen mode because a 1 pixel move actually moves 2 pixels. In Full Screen mode a 1 pixel move, moves 1 pixel, giving each shape another 1-2 pixels freedom of movement in each direction without registering contact with other Shapes or the Frame, making it solvable (although it's still a very tight fit). Strangely, after clicking the Flag & switching to Full Screen mode, if you then switch back to Normal Screen mode, you end up with 1 pixel moves actually moving 1 pixel, and then it is just as easy to solve. Clearly that means it's a Scratch Bug that it doesn't work in Normal Screen mode unless you switch to Full Screen (after clicking the Flag) & then back to Normal Screen mode.
Created by @gregatku for use in Coding Classes for Kids Unlimited, for whom I work as a Coding teacher. I saw a picture of a Wooden Version of this Puzzle, and thought it looked interesting so I made a Scratch version. There are 2 distinct solutions, one for each of the Black Square's orientations. The various rotations and reflections of them, aren't different solutions. Thanks greatly to @papipupepappa for making the Flip button work exactly the way the image on the button suggests it should! For anyone interested in his recommended changes to my code, they are all the blocks in the Pieces sprite, that use the Local Variable "my flip angle". So there was only about 15-20 hours involved in writing the code, but about 100 hours involved in drawing the Shapes to make it so that not only were both solutions doable (even on my Mobile Phone), but also so that "fake" solutions by interchanging the 2 triangles were impossible. If I knew what I do now about Vector Drawn sprites, it should have only taken about 10 hours. To prevent "fake" solutions by swapping over the Triangles, a "real" solution must almost completely fill the Puzzle frame, so lots of time was wasted slightly adjusting each Shape's size, often making a Shape 1 pixel higher/lower/wider/narrower. Facts I learned in the process: 1. All 90 & 45 degree angles in the Shape must be exact; 2. If they aren't, even in just one shape, contact detection between that shape & any other wouldn't work properly; 3. Changing a shape's size in the orthogonal directions, will change the angles ever so slightly often imperceptibly; 4. If you change a Shape's dimensions using the Reshape Tool, you are almost certain to change the Angles; 5. The closer I got to having all the Shapes the right size, the harder it became to actually solve it; 6. Then the light bulb moment came ... I decided to redraw all the coloured Shapes using the Line Tool over a copy of the "almost" correct Shapes I already had; 7. To ensure all angles were perfect, I had to hold Shift down for every line, and if the last Line did not perfectly click in to the starting point (to close the Shape), I couldn't just move over until it did (that would make the Angle imperfect), so I had to undo back a line or 2 to adjust the length of the Line that was slightly the wrong length, until I got a perfect closure; 8. BINGO! The project suddenly worked "perfectly", Shapes could actually sit right next to each other with no perceptible gap between them & contact between them would not be detected. Solving it was suddenly easier than in the previous 100 hours. But it didn't end there! OMG, I found I could still force a "fake" solution! Back to the drawing board, but no change to any of the Shapes. I decided detection of stuff on the backdrop was the source of the problem. I split the Brown Square and the Frame around it (previously in the backdrop) into 2 Sprites, so that Brown Square was actually a square, and used "touching Brown Square" rather than touching its fill colour. 8 hours of tweaking later to get the 2 new sprites right. And finally the project was at last complete and worked the way it should? But NO! In Full Screen mode I could still force 1 "fake" solution, so back to drawing board for another 4 hours. Then I spent another 10 hours on it because once again I found I could still force a "fake" solution. Not any more! Problem was you make one shape one pixel bigger to prevent a "fake" solution and then you find because of that change one of the "real" solutions stops working and vice-versa. But I did touch it again? Trouble was sometimes to make a real solution work, 2 Shapes that should be able to sit next to each other on an edge had to be offset from each other by a pixel - that's not right. Decided "not (touching colour)" was not as precise as "not (touching sprite)", so I removed the dependence on (touching colour)! That helped - much easier to fix ... All DONE? NO! Nah, as close as I could get them, wasn't close enough. The 2nd smallest Shape, needed a reshape & size. Now at last it is DONE!! Added a couple "nice to have" features too, including a nice woodgrain base that was very time consuming & fiddly and making the keyboard arrows work too (at the request of @KICK_THE_HABIT). I have since come back to it again, having found a reliable way to make minor adjustments to a shape's size without changing any of the angles involved. So I further enlarged a few shapes, so the 2 solutions are now an extremely tight fit with very little margin for error and fake solutions are now impossible. It's now virtually unsolvable in Normal Screen mode. It was a really fun project, that helped me forget about my frustration of 11 weeks of hard Covid Lockdown with a 9:00 pm curfew in my home town of Melbourne, which is finally over. Hope you enjoy the challenge of solving it as much as I did creating it, but hopefully it won't be quite as frustrating as making it work properly. Regards Greg