Using jGoBoard 2.0

This page is about jGoBoard 2.0. There is still a separate page on using jGoBoard 1.0.

How to use it

1. Download jGoBoard 2.0

2. Copy the jgo2 folder to your web application directory

3. Add the stylesheet, jQuery library and jGoBoard library to page header:

<link rel="stylesheet" href="jgo2/jgoboard.css" type="text/css" />
<script type="text/javascript"
<script type="text/javascript" src="jgo2/jgoboard.js"></script>

Make a simple element for your go board:

<div class="jgo_board" id="board"></div>

After the page has loaded, generate the board using JavaScript:

$(document).ready(function(){ // jQuery way
    board = jgo_generateBoard($("#board"));

4. Use simple commands to manipulate the board:

coord = new JGOCoordinate("K10"); // Coordinate pointing at tengen

if(board.get(coord) == JGO_CLEAR) // if no stone at tengen
    board.set(coord, JGO_BLACK); // put a black stone in it

5. jGoBoard is compact, simple and clearly documented – see jgoboard.js for all functionality and .html files for examples of usage.

Leave a Reply

Your email address will not be published. Required fields are marked *