ChessPier: A chess game with jQuery (only human vs human)

  • 23 Ago 2012
  • Resources, jQuery

Days ago, I developed a chess game with jQuery to play alone among humans. Could be useful for sites with chess problems.

Works well on touchscreen devices.

It's so simple to use:

$(document).ready(function(){
  $(this).chesspier();
});

It can receive a certain position through two variables named white and black in the url.

$(document).ready(function(){

  if (getQueryVariable("white") != false) {
    var white = getQueryVariable("white");
  } else {
    var white = "RA1,RH1,NB1,NG1,BC1,BF1,QD1,KE1,PA2,PB2,PC2,PD2,PE2,PF2,PG2,PH2";
  }

  if (getQueryVariable("black") != false) {
    var black = getQueryVariable("black");
  } else {
    var black = "RA8,RH8,NB8,NG8,BC8,BF8,QD8,KE8,PA7,PB7,PC7,PD7,PE7,PF7,PG7,PH7";
  }

  $(this).chesspier({
    white: getQueryVariable("white"),
    black: getQueryVariable("black")
  });
});

Here, a demo to start the game.