ScratchData LogoScratchData
Back to _nix's profile

[AMC#6] Clone Brute-Force

_N_nix•Created February 6, 2017
[AMC#6] Clone Brute-Force
3
1
56 views
View on Scratch

Instructions

Press the green flag to begin. The whole project (and likely your web browser) is going to lag lots while running. Once you hear some clicking sounds, the project is checking whether or not a proper solution was found. When the clicking stops, a solution may have (hopefully) been found, which should be drawn to the map. After the project is finished, if you had set "kill ended clones" to 0, then press D, you can look through each of the resulting paths (paths that go from 1 to the end). Only a couple will be solutions, but it's interesting to browse through anyways. (Navigate with the arrow keys and "index" slider.) If the path doesn't get shown when it's done you might need to restart the project with "kill ended clones" set to 0; then press D and adjust the index to the very end.

Description

This "algorithm" is really just a brute force that runs on clones. I went with clones because they make keeping track of "first-class" arrays /very/ easy. However, when you run the project, you'll see that there's often 300 clones at once, which is Scratch's limit.. thankfully the program *does* find the answer to this puzzle within the clone limit, but there's certainly no guarantee it'd work in other layouts. It's certainly possible to do this with lists, and almost definitely better that way, but I'm not really sure how to manage first class lists on a single sprite well, and I liked the idea of using clones. Proofs of concept! :P (This project would likely always work if the clone limit were higher (and people had faster computers).)

Project Details

Project ID143719133
CreatedFebruary 6, 2017
Last ModifiedFebruary 6, 2017
SharedFebruary 6, 2017
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root