puzzle using HTML5 canvas and javascript