Weeks 10 - 12
2nd Quiz : Monday, April 24.
Form elements review
Here's a place to try things out.
Make it so that your script determines when the puzzle has been solved. That is: whenever the picture is reassembled by the user (that is, all seven pieces are adjacent to one another in the "proper" order (the order they were occupied in your original picture) then:
Here are some of the things I'll talk about in class:
swap to red -- annotated example that shows how the first swap works to swap contents of last position with any image clicked upon
<img src="pic7.jpg" onclick="f(7)">
See strategies, below.
1. Load images in "solved" order first then determine resolved file addresses (see for example here)
2. Use string manipulation to pull off only the relevant characters
3. Remember which image is where through an array
New stuff for coming weeks:
random numbers, (teleology, mechanism and pragmatism) and evaluating a random number generator