The tictactoe.game HTML Element

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>    

Small Board

<tictactoe.game size="3"/>    

Big Board

<tictactoe.game size="5"/>    

Wire Up A Scoreboard

<tictactoe.game style="float:left" size="3" history="{{ winners }}"/>
<tictactoe.scoreboard history="{{ winners }}"/>    

rankplayerscore
1cat0
2O0
3X0
Source Code