This page demonstrates the use of a custom DOM element, implemented in ClojureScript, to include two instances of differently parameterized Tic Tac Toe games.
The first tag on this page imports the tailrecursion.hoplon-demos.tictactoe library and defines a cell in which to store the historical record of winners:
<script type="text/hoplon">
(page "advanced.html"
(:require [tailrecursion.hoplon-demos.tictactoe :as tictactoe]))
(defc winners nil)
</script> <tictactoe.game size="3"/>
<tictactoe.game size="5"/>
<tictactoe.game style="float:left" size="3" history="{{ winners }}"/>
<tictactoe.scoreboard history="{{ winners }}"/> | rank | player | score |
|---|---|---|
| 1 | cat | 0 |
| 2 | O | 0 |
| 3 | X | 0 |