Created
March 14, 2014 10:26
-
-
Save cjohansen/9545340 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var target = document.getElementById("puzzle-container"); | |
| var picture = target.getElementsByTagName("img")[0].src; | |
| function render(game, player) { | |
| var puzzleUI = Pizuzzle({ | |
| layout: player.layout, | |
| picture: player.picture, | |
| move: function (slot) { | |
| game.move(player, slot.id); | |
| render(game, player); | |
| } | |
| }); | |
| React.renderComponent(puzzleUI, target); | |
| } | |
| var game = puzzle.createGame(3); | |
| var player = game.addPlayer("Christian", picture); | |
| render(game, player); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment