game board
 B
 A



Javascript taken from www.switchonthecode.com