-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathexample.htm
33 lines (26 loc) · 995 Bytes
/
example.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!-- This file is an example to show how easily the scramble plugins from Mark 2 can be used on any website. -->
<html>
<head>
<title>Scramble Usage Example</title>
<!-- Raphael.js is used for drawing the scrambles. You can leave it out if you don't use the drawing code. -->
<script src="./lib/raphael-min.js"></script>
<!-- Include the files for the puzzles you want. -->
<script src="scramble_222.js"></script>
</head>
<body>
<script>
// Tell the scrambler to initialize its tables.
scramblers["222"].initialize();
for (var i=1; i <= 5; i++) {
// Generate a random scramble
var randomScramble = scramblers["222"].getRandomScramble();
// Print it
document.write("" + i + ". " + randomScramble.scramble_string + "<br>");
// Create an element and draw the scramble in it.
var newDiv = document.createElement("div");
scramblers["222"].drawScramble(newDiv, randomScramble.state, 100, 80);
document.body.appendChild(newDiv);
}
</script>
</body>
</html>