Your browser lacks required capabilities. Please upgrade it or switch to another to continue.
Loading…
Welcome to Ghost Pieces.
<nav class="navigation">
<ul class="mainmenu">
<li>[[♛Play->welcome2]]</li>
<li>[[♛Settings->menu]]</li>
<li>[[♛Rules->rules]]</li>
<li>[[♛About->about]]</li>
</ul>
</nav>
<<set $sq1 to "">>\
<<set $square1 to random(1, 64)>>\
<<if $square1 is 1>><<set $sq1 to "a1">>\
<<elseif $square1 is 2>><<set $sq1 to "b1">>\
<<elseif $square1 is 3>><<set $sq1 to "c1">>\
<<elseif $square1 is 4>><<set $sq1 to "d1">>\
<<elseif $square1 is 5>><<set $sq1 to "e1">>\
<<elseif $square1 is 6>><<set $sq1 to "f1">>\
<<elseif $square1 is 7>><<set $sq1 to "g1">>\
<<elseif $square1 is 8>><<set $sq1 to "h1">>\
<<elseif $square1 is 9>><<set $sq1 to "h2">>\
<<elseif $square1 is 10>><<set $sq1 to "g2">>\
<<elseif $square1 is 11>><<set $sq1 to "f2">>\
<<elseif $square1 is 12>><<set $sq1 to "e2">>\
<<elseif $square1 is 13>><<set $sq1 to "d2">>\
<<elseif $square1 is 14>><<set $sq1 to "c2">>\
<<elseif $square1 is 15>><<set $sq1 to "b2">>\
<<elseif $square1 is 16>><<set $sq1 to "a2">>\
<<elseif $square1 is 17>><<set $sq1 to "a3">>\
<<elseif $square1 is 18>><<set $sq1 to "b3">>\
<<elseif $square1 is 19>><<set $sq1 to "c3">>\
<<elseif $square1 is 20>><<set $sq1 to "d3">>\
<<elseif $square1 is 21>><<set $sq1 to "e3">>\
<<elseif $square1 is 22>><<set $sq1 to "f3">>\
<<elseif $square1 is 23>><<set $sq1 to "g3">>\
<<elseif $square1 is 24>><<set $sq1 to "h3">>\
<<elseif $square1 is 25>><<set $sq1 to "h4">>\
<<elseif $square1 is 26>><<set $sq1 to "g4">>\
<<elseif $square1 is 27>><<set $sq1 to "f4">>\
<<elseif $square1 is 28>><<set $sq1 to "e4">>\
<<elseif $square1 is 29>><<set $sq1 to "d4">>\
<<elseif $square1 is 30>><<set $sq1 to "c4">>\
<<elseif $square1 is 31>><<set $sq1 to "b4">>\
<<elseif $square1 is 32>><<set $sq1 to "a4">>\
<<elseif $square1 is 33>><<set $sq1 to "a5">>\
<<elseif $square1 is 34>><<set $sq1 to "b5">>\
<<elseif $square1 is 35>><<set $sq1 to "c5">>\
<<elseif $square1 is 36>><<set $sq1 to "d5">>\
<<elseif $square1 is 37>><<set $sq1 to "e5">>\
<<elseif $square1 is 38>><<set $sq1 to "f5">>\
<<elseif $square1 is 39>><<set $sq1 to "g5">>\
<<elseif $square1 is 40>><<set $sq1 to "h5">>\
<<elseif $square1 is 41>><<set $sq1 to "h6">>\
<<elseif $square1 is 42>><<set $sq1 to "g6">>\
<<elseif $square1 is 43>><<set $sq1 to "f6">>\
<<elseif $square1 is 44>><<set $sq1 to "e6">>\
<<elseif $square1 is 45>><<set $sq1 to "d6">>\
<<elseif $square1 is 46>><<set $sq1 to "c6">>\
<<elseif $square1 is 47>><<set $sq1 to "b6">>\
<<elseif $square1 is 48>><<set $sq1 to "a6">>\
<<elseif $square1 is 49>><<set $sq1 to "a7">>\
<<elseif $square1 is 50>><<set $sq1 to "b7">>\
<<elseif $square1 is 51>><<set $sq1 to "c7">>\
<<elseif $square1 is 52>><<set $sq1 to "d7">>\
<<elseif $square1 is 53>><<set $sq1 to "e7">>\
<<elseif $square1 is 54>><<set $sq1 to "f7">>\
<<elseif $square1 is 55>><<set $sq1 to "g7">>\
<<elseif $square1 is 56>><<set $sq1 to "h7">>\
<<elseif $square1 is 57>><<set $sq1 to "h8">>\
<<elseif $square1 is 58>><<set $sq1 to "g8">>\
<<elseif $square1 is 59>><<set $sq1 to "f8">>\
<<elseif $square1 is 60>><<set $sq1 to "e8">>\
<<elseif $square1 is 61>><<set $sq1 to "d8">>\
<<elseif $square1 is 62>><<set $sq1 to "c8">>\
<<elseif $square1 is 63>><<set $sq1 to "b8">>\
<<elseif $square1 is 64>><<set $sq1 to "a8">>\
<</if>>\
Square: $sq1
<<button " WHITE " "white">><</button>> <<button " BLACK " "black">><</button>>
<<if $clock eq 5>>
<div class="time-bar"><span class="w0"></span></div><<timed 5s>><<goto "timeout">><</timed>>
<<elseif $clock eq 10>>
<div class="time-bar"><span class="w1"></span></div>
<<timed 10s>><<goto "timeout">><</timed>>
<<elseif $clock eq 15>>
<div class="time-bar"><span class="w2"></span></div>
<<timed 15s>><<goto "timeout">><</timed>>
<<elseif $clock eq 30>>
<div class="time-bar"><span class="w3"></span></div>
<<timed 30s>><<goto "timeout">><</timed>>
<<elseif $clock eq 60>>
<div class="time-bar"><span class="w4"></span></div>
<<timed 60s>><<goto "timeout">><</timed>>
<<elseif $clock eq 120>>
<div class="time-bar"><span class="w5"></span></div>
<<timed 120s>><<goto "timeout">><</timed>>
<</if>>
<<audio "ticktock" play>>
<<audio "ticktock" loop>><<set $sq1 to "">>\
<<set $square1 to random(1, 32)>>\
<<if $square1 is 1>><<set $sq1 to "a1">>\
<<elseif $square1 is 2>><<set $sq1 to "b1">>\
<<elseif $square1 is 3>><<set $sq1 to "c1">>\
<<elseif $square1 is 4>><<set $sq1 to "d1">>\
<<elseif $square1 is 5>><<set $sq1 to "e1">>\
<<elseif $square1 is 6>><<set $sq1 to "f1">>\
<<elseif $square1 is 7>><<set $sq1 to "g1">>\
<<elseif $square1 is 8>><<set $sq1 to "h1">>\
<<elseif $square1 is 9>><<set $sq1 to "h2">>\
<<elseif $square1 is 10>><<set $sq1 to "g2">>\
<<elseif $square1 is 11>><<set $sq1 to "f2">>\
<<elseif $square1 is 12>><<set $sq1 to "e2">>\
<<elseif $square1 is 13>><<set $sq1 to "d2">>\
<<elseif $square1 is 14>><<set $sq1 to "c2">>\
<<elseif $square1 is 15>><<set $sq1 to "b2">>\
<<elseif $square1 is 16>><<set $sq1 to "a2">>\
<<elseif $square1 is 17>><<set $sq1 to "a3">>\
<<elseif $square1 is 18>><<set $sq1 to "b3">>\
<<elseif $square1 is 19>><<set $sq1 to "c3">>\
<<elseif $square1 is 20>><<set $sq1 to "d3">>\
<<elseif $square1 is 21>><<set $sq1 to "e3">>\
<<elseif $square1 is 22>><<set $sq1 to "f3">>\
<<elseif $square1 is 23>><<set $sq1 to "g3">>\
<<elseif $square1 is 24>><<set $sq1 to "h3">>\
<<elseif $square1 is 25>><<set $sq1 to "h4">>\
<<elseif $square1 is 26>><<set $sq1 to "g4">>\
<<elseif $square1 is 27>><<set $sq1 to "f4">>\
<<elseif $square1 is 28>><<set $sq1 to "e4">>\
<<elseif $square1 is 29>><<set $sq1 to "d4">>\
<<elseif $square1 is 30>><<set $sq1 to "c4">>\
<<elseif $square1 is 31>><<set $sq1 to "b4">>\
<<elseif $square1 is 32>><<set $sq1 to "a4">>\
<<elseif $square1 is 33>><<set $sq1 to "a5">>\
<<elseif $square1 is 34>><<set $sq1 to "b5">>\
<<elseif $square1 is 35>><<set $sq1 to "c5">>\
<<elseif $square1 is 36>><<set $sq1 to "d5">>\
<<elseif $square1 is 37>><<set $sq1 to "e5">>\
<<elseif $square1 is 38>><<set $sq1 to "f5">>\
<<elseif $square1 is 39>><<set $sq1 to "g5">>\
<<elseif $square1 is 40>><<set $sq1 to "h5">>\
<<elseif $square1 is 41>><<set $sq1 to "h6">>\
<<elseif $square1 is 42>><<set $sq1 to "g6">>\
<<elseif $square1 is 43>><<set $sq1 to "f6">>\
<<elseif $square1 is 44>><<set $sq1 to "e6">>\
<<elseif $square1 is 45>><<set $sq1 to "d6">>\
<<elseif $square1 is 46>><<set $sq1 to "c6">>\
<<elseif $square1 is 47>><<set $sq1 to "b6">>\
<<elseif $square1 is 48>><<set $sq1 to "a6">>\
<<elseif $square1 is 49>><<set $sq1 to "a7">>\
<<elseif $square1 is 50>><<set $sq1 to "b7">>\
<<elseif $square1 is 51>><<set $sq1 to "c7">>\
<<elseif $square1 is 52>><<set $sq1 to "d7">>\
<<elseif $square1 is 53>><<set $sq1 to "e7">>\
<<elseif $square1 is 54>><<set $sq1 to "f7">>\
<<elseif $square1 is 55>><<set $sq1 to "g7">>\
<<elseif $square1 is 56>><<set $sq1 to "h7">>\
<<elseif $square1 is 57>><<set $sq1 to "h8">>\
<<elseif $square1 is 58>><<set $sq1 to "g8">>\
<<elseif $square1 is 59>><<set $sq1 to "f8">>\
<<elseif $square1 is 60>><<set $sq1 to "e8">>\
<<elseif $square1 is 61>><<set $sq1 to "d8">>\
<<elseif $square1 is 62>><<set $sq1 to "c8">>\
<<elseif $square1 is 63>><<set $sq1 to "b8">>\
<<elseif $square1 is 64>><<set $sq1 to "a8">>\
<</if>>\
<<set $sq2 to "">>\
<<set $square2 to random(33, 64)>>\
<<if $square2 is 1>><<set $sq2 to "a1">>\
<<elseif $square2 is 2>><<set $sq2 to "b1">>\
<<elseif $square2 is 3>><<set $sq2 to "c1">>\
<<elseif $square2 is 4>><<set $sq2 to "d1">>\
<<elseif $square2 is 5>><<set $sq2 to "e1">>\
<<elseif $square2 is 6>><<set $sq2 to "f1">>\
<<elseif $square2 is 7>><<set $sq2 to "g1">>\
<<elseif $square2 is 8>><<set $sq2 to "h1">>\
<<elseif $square2 is 9>><<set $sq2 to "h2">>\
<<elseif $square2 is 10>><<set $sq2 to "g2">>\
<<elseif $square2 is 11>><<set $sq2 to "f2">>\
<<elseif $square2 is 12>><<set $sq2 to "e2">>\
<<elseif $square2 is 13>><<set $sq2 to "d2">>\
<<elseif $square2 is 14>><<set $sq2 to "c2">>\
<<elseif $square2 is 15>><<set $sq2 to "b2">>\
<<elseif $square2 is 16>><<set $sq2 to "a2">>\
<<elseif $square2 is 17>><<set $sq2 to "a3">>\
<<elseif $square2 is 18>><<set $sq2 to "b3">>\
<<elseif $square2 is 19>><<set $sq2 to "c3">>\
<<elseif $square2 is 20>><<set $sq2 to "d3">>\
<<elseif $square2 is 21>><<set $sq2 to "e3">>\
<<elseif $square2 is 22>><<set $sq2 to "f3">>\
<<elseif $square2 is 23>><<set $sq2 to "g3">>\
<<elseif $square2 is 24>><<set $sq2 to "h3">>\
<<elseif $square2 is 25>><<set $sq2 to "h4">>\
<<elseif $square2 is 26>><<set $sq2 to "g4">>\
<<elseif $square2 is 27>><<set $sq2 to "f4">>\
<<elseif $square2 is 28>><<set $sq2 to "e4">>\
<<elseif $square2 is 29>><<set $sq2 to "d4">>\
<<elseif $square2 is 30>><<set $sq2 to "c4">>\
<<elseif $square2 is 31>><<set $sq2 to "b4">>\
<<elseif $square2 is 32>><<set $sq2 to "a4">>\
<<elseif $square2 is 33>><<set $sq2 to "a5">>\
<<elseif $square2 is 34>><<set $sq2 to "b5">>\
<<elseif $square2 is 35>><<set $sq2 to "c5">>\
<<elseif $square2 is 36>><<set $sq2 to "d5">>\
<<elseif $square2 is 37>><<set $sq2 to "e5">>\
<<elseif $square2 is 38>><<set $sq2 to "f5">>\
<<elseif $square2 is 39>><<set $sq2 to "g5">>\
<<elseif $square2 is 40>><<set $sq2 to "h5">>\
<<elseif $square2 is 41>><<set $sq2 to "h6">>\
<<elseif $square2 is 42>><<set $sq2 to "g6">>\
<<elseif $square2 is 43>><<set $sq2 to "f6">>\
<<elseif $square2 is 44>><<set $sq2 to "e6">>\
<<elseif $square2 is 45>><<set $sq2 to "d6">>\
<<elseif $square2 is 46>><<set $sq2 to "c6">>\
<<elseif $square2 is 47>><<set $sq2 to "b6">>\
<<elseif $square2 is 48>><<set $sq2 to "a6">>\
<<elseif $square2 is 49>><<set $sq2 to "a7">>\
<<elseif $square2 is 50>><<set $sq2 to "b7">>\
<<elseif $square2 is 51>><<set $sq2 to "c7">>\
<<elseif $square2 is 52>><<set $sq2 to "d7">>\
<<elseif $square2 is 53>><<set $sq2 to "e7">>\
<<elseif $square2 is 54>><<set $sq2 to "f7">>\
<<elseif $square2 is 55>><<set $sq2 to "g7">>\
<<elseif $square2 is 56>><<set $sq2 to "h7">>\
<<elseif $square2 is 57>><<set $sq2 to "h8">>\
<<elseif $square2 is 58>><<set $sq2 to "g8">>\
<<elseif $square2 is 59>><<set $sq2 to "f8">>\
<<elseif $square2 is 60>><<set $sq2 to "e8">>\
<<elseif $square2 is 61>><<set $sq2 to "d8">>\
<<elseif $square2 is 62>><<set $sq2 to "c8">>\
<<elseif $square2 is 63>><<set $sq2 to "b8">>\
<<elseif $square2 is 64>><<set $sq2 to "a8">>\
<</if>>
Square 1: $sq1
Square 2: $sq2
<<button " YES " "yes">><</button>> <<button " NO " "no">><</button>>
<<if $clock eq 5>>
<div class="time-bar"><span class="w0"></span></div><<timed 5s>><<goto "timeout">><</timed>>
<<elseif $clock eq 10>>
<div class="time-bar"><span class="w1"></span></div>
<<timed 10s>><<goto "timeout">><</timed>>
<<elseif $clock eq 15>>
<div class="time-bar"><span class="w2"></span></div>
<<timed 15s>><<goto "timeout">><</timed>>
<<elseif $clock eq 30>>
<div class="time-bar"><span class="w3"></span></div>
<<timed 30s>><<goto "timeout">><</timed>>
<<elseif $clock eq 60>>
<div class="time-bar"><span class="w4"></span></div>
<<timed 60s>><<goto "timeout">><</timed>>
<<elseif $clock eq 120>>
<div class="time-bar"><span class="w5"></span></div>
<<timed 120s>><<goto "timeout">><</timed>>
<</if>>
<<audio "ticktock" play>>
<<audio "ticktock" loop>>
<<audio "ticktock" stop>>
hey $name
Your highscore is: $points
<html><div class="ss-form"><form action="https://docs.google.com/forms/d/e/1FAIpQLSerWfYahrItrKtN83pkEM0cYJdb0cvhakv2ZeLboEn2_AdIZw/formResponse" method="POST" id="ss-form" target="_self" autocomplete="on" onsubmit=""><ol role="list" class="ss-question-list" style="padding-left: 0;">
<div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item ss-text"><div class="ss-form-entry">
<label class="ss-q-item-label" for="entry_816981504"><div class="ss-q-title">
</div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
<input type="hidden" name="entry.816981504" value="" class="ss-q-short" id="entry_816981504" dir="auto" aria-label="Name: " title="">
<div class="error-message" id="1022862133_errorMessage"></div>
<div class="required-message"></div>
</div></div></div> <div class="ss-form-question errorbox-good" role="listitem">
<div dir="auto" class="ss-item ss-text"><div class="ss-form-entry">
<label class="ss-q-item-label" for="entry_223958687"><div class="ss-q-title">
</div>
<div class="ss-q-help ss-secondary-text" dir="auto"></div></label>
<input type="hidden" name="entry.223958687" value="" class="ss-q-short" id="entry_223958687" dir="auto" aria-label="Score: " title="">
<div class="error-message" id="815462271_errorMessage"></div>
<div class="required-message"></div>
</div></div></div>
<input type="hidden" name="draftResponse" value="[null,null,"543221514949115966"]
">
<input type="hidden" name="pageHistory" value="0">
<input type="hidden" name="fbzx" value="543221514949115966">
<div class="ss-send-email-receipt" style="margin-bottom: 4px;" dir="ltr"><label for="emailReceipt" style="display:inline;"></label></div>
<div class="ss-item ss-navigate"><table id="navigation-table"><tbody><tr><td class="ss-form-entry goog-inline-block" id="navigation-buttons" dir="ltr">
<input type="submit" name="submit" value="Upload Highscore" id="ss-submit" class="jfk-button jfk-button-action ">
<div class="ss-password-warning ss-secondary-text"></div></td>
</tr></tbody></table></div></ol></form></div></html><<googleForms "$name" "$points">>
<a href="https://arunjchess.github.io/Chess_test/leaderboard.html">Visit Leader Board</a>
<<button "Back" "progress">><</button>><<audio "ticktock" stop>>\
<<if $square1 % 2 is 0>>\
<<set $points to $points + 1>>\
You got it right!
<<elseif $square1 % 2 neq 0>>\
<<set $points to $points - 1>>\
Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wX';
ChessBoard('board', position);
};
<</script>>\
<</if>>\
<<if $points lt 0>><<set $points to 0>><<endif>>\
<<button "Next Puzzle" "level_1">><</button>>
Total Points: $points
<<button "Help" "r1">><</button>><<audio "ticktock" stop>>\
<<if $square1 % 2 is 0>>\
<<set $points to $points - 1>>\
Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wX';
ChessBoard('board', position);
};
<</script>>
<<elseif $square1 % 2 neq 0>>
<<set $points to $points + 1>>
You got it right!
<</if>>\
<<if $points lt 0>><<set $points to 0>><<endif>>\
<<button "Next Puzzle" "level_1">><</button>>
Total Points: $points
<<button "Help" "r1">><</button>><<audio "ticktock" stop>>\
<<if $square1 % 2 is $square2 % 2>>\
<<set $points to $points + 1.5>>\
You got it right!
<<elseif $sqare % 2 neq $square2 % 2>>\
<<set $points to $points - 1>>\
Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wX';
position[State.variables.sq2] = 'wX';
ChessBoard('board', position);
};
<</script>>\
<</if>>\
<<if $points lt 0>><<set $points to 0>><<endif>>\
<<button "Next Puzzle" "level_2">><</button>>
Total Points: $points
<<button "Help" "r3">><</button>><<audio "ticktock" stop>>\
<<if $square1 % 2 is $square2 % 2>>\
<<set $points to $points - 1>>\
Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wX';
position[State.variables.sq2] = 'wX';
ChessBoard('board', position);
};
<</script>>\
<<elseif $sqare % 2 neq $square2 % 2>>\
<<set $points to $points + 1.5>>\
You got it right!
<</if>>\
<<if $points lt 0>><<set $points to 0>><<endif>>\
<<button "Next Puzzle" "level_2">><</button>>
Total Points: $points
<<button "Help" "r3">><</button>><nav class="navigation">
<ul class="mainmenu">
<li>[[♛Easy->easy]]</li>
<li>[[♛Medium->medium]]</li>
<li>[[♛Hard->hard]]</li>
<li>[[♛Settings->menu]]</li>
</ul>
</nav>
<<audio "ticktock" stop>><nav class="navigation">
<ul class="mainmenu">
<li>[["♛Choose Level"->welcome2]]</li>
<li>[["♛Timer Settings"->clock]]</li>
<li>[["♛Rules"->rules]]</li>
<li>[["♛Progress"->progress]]</li>
</ul>
</nav><<set $x to random(1,20)>>\
<<set $sq1 to "">>\
<<set $sq2 to "">>\
<<if $x is 1>>\
<<set $sq1 to "e3">>\
<<set $sq2 to "h6">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 2>>\
<<set $sq1 to "a4">>\
<<set $sq2 to "e1">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "wrong">><</button>> <<button " NO " "right">><</button>>\
<<elseif $x is 3>>\
<<set $sq1 to "g1">>\
<<set $sq2 to "a7">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 4>>\
<<set $sq1 to "d7">>\
<<set $sq2 to "g3">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "wrong">><</button>> <<button " NO " "right">><</button>>\
<<elseif $x is 5>>\
<<set $sq1 to "e1">>\
<<set $sq2 to "h4">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 6>>\
<<set $sq1 to "d5">>\
<<set $sq2 to "g8">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 7>>\
<<set $sq1 to "b8">>\
<<set $sq2 to "e4">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "wrong">><</button>> <<button " NO " "right">><</button>>\
<<elseif $x is 8>>\
<<set $sq1 to "e2">>\
<<set $sq2 to "b5">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 9>>\
<<set $sq1 to "e8">>\
<<set $sq2 to "a5">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "wrong">><</button>> <<button " NO " "right">><</button>>\
<<elseif $x is 10>>\
<<set $sq1 to "a7">>\
<<set $sq2 to "f2">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 11>>\
<<set $sq1 to "a8">>\
<<set $sq2 to "f3">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 12>>\
<<set $sq1 to "f2">>\
<<set $sq2 to "b6">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 13>>\
<<set $sq1 to "h4">>\
<<set $sq2 to "d8">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 14>>\
<<set $sq1 to "e3">>\
<<set $sq2 to "b5">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "wrong">><</button>> <<button " NO " "right">><</button>>\
<<elseif $x is 15>>\
<<set $sq1 to "b2">>\
<<set $sq2 to "f6">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 16>>\
<<set $sq1 to "a7">>\
<<set $sq2 to "d4">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<<elseif $x is 17>>\
<<set $sq1 to "d2">>\
<<set $sq2 to "b5">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "wrong">><</button>> <<button " NO " "right">><</button>>\
<<elseif $x is 18>>\
<<set $sq1 to "f2">>\
<<set $sq2 to "h5">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "wrong">><</button>> <<button " NO " "right">><</button>>\
<<elseif $x is 19>>\
<<set $sq1 to "d6">>\
<<set $sq2 to "h3">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "wrong">><</button>> <<button " NO " "right">><</button>>\
<<elseif $x is 20>>\
<<set $sq1 to "c5">>\
<<set $sq2 to "g1">>\
Square 1: $sq1
Square 2: $sq2
<<button " YES " "right">><</button>> <<button " NO " "wrong">><</button>>\
<</if>>\
<<if $clock eq 5>>
<div class="time-bar"><span class="w0"></span></div><<timed 5s>><<goto "timeout">><</timed>>
<<elseif $clock eq 10>>
<div class="time-bar"><span class="w1"></span></div>
<<timed 10s>><<goto "timeout">><</timed>>
<<elseif $clock eq 15>>
<div class="time-bar"><span class="w2"></span></div>
<<timed 15s>><<goto "timeout">><</timed>>
<<elseif $clock eq 30>>
<div class="time-bar"><span class="w3"></span></div>
<<timed 30s>><<goto "timeout">><</timed>>
<<elseif $clock eq 60>>
<div class="time-bar"><span class="w4"></span></div>
<<timed 60s>><<goto "timeout">><</timed>>
<<elseif $clock eq 120>>
<div class="time-bar"><span class="w5"></span></div>
<<timed 120s>><<goto "timeout">><</timed>>
<</if>>
<<audio "ticktock" play>>
<<audio "ticktock" loop>>
<<audio "ticktock" stop>>
<<set $points to $points - 1>>\
Uh, oh. Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wX';
position[State.variables.sq2] = 'wX';
ChessBoard('board', position);
};
<</script>>
<<if $points lt 0>><<set $points to 0>><<endif>>\
<<button "Next Puzzle" "level_3">><</button>>
Total Points: $points
<<button "Help" "r4">><</button>><<audio "ticktock" stop>>\
<<set $points to $points + 1.5>>\
Yay! Right Answer
<<button "Next Puzzle" "level_3">><</button>>
Total Points: $points
<<button "Help" "r4">><</button>>Set Countdown timer using the below options.
<<dropdown '$clock' '5' '10' '15' '30' '60' '120' >><<button "Save" "menu">> <</button>>
<<audio "ticktock" stop>>
<<script>>
// dropdown macro, by chapel; for sugarcube 2
// version 1.1
// see the documentation: https://github.com/ChapelR/custom-macros-for-sugarcube-2#dropdown-macro
// <<dropdown>> macro
Macro.add('dropdown', {
handler : function () {
var $wrapper = $(document.createElement('span'));
var $drop = $(document.createElement('select'));
var opts = this.args;
var storyVar = opts.shift();
var store;
var i;
// add array handling for args (v1.1)
opts = (function (options) {
var arr = [];
options.forEach( function (val) {
if (Array.isArray(val)) {
arr = arr.concat(val);
} else {
arr.push(val);
}
});
return arr;
}(opts));
// handle simple errors
if (typeof storyVar == 'undefined') {
return this.error('No arguments provided.');
}
if (opts.length < 1) {
return this.error('Must provide at least one list option.');
}
if (storyVar.charAt(0) === '$') {
store = State.variables;
} else if (storyVar.charAt(0) === '_') {
store = State.temporary;
} else {
return this.error('First argument should be a valid TwineScript variable.');
}
storyVar = storyVar.slice(1);
store[storyVar] = opts[0];
for (i = 0; i < opts.length; i++) {
var $option = $(document.createElement('option'));
$option
.attr('value', opts[i])
.wiki(opts[i])
.appendTo($drop);
}
$drop
.attr({
name : 'dropdown-macro',
id : storyVar
})
.appendTo($wrapper);
$wrapper
.addClass('macro-' + this.name)
.appendTo(this.output);
$(document).on('change', 'select#' + storyVar, function () {
store[storyVar] = $('select#' + storyVar).val();
})
}
});
<</script>><<cacheaudio "ticktock" "audio/clocktick2.wav">>
<<set $clock to 10>>
<<set $points to 0>>
<<set $name to "">>
<<set $sq1 to "e4">>\
<<set $sq2 to "c7">>\
<<set $sq3 to "g3">>\
<<set $sq4 to "a2">>\
Game Rules:
Level: Easy
[["Game 1: Square Colours"->r1]]
[["Game 2: Alien Capture"->r2]]
Level: Medium
[["Game 1: Two Squares"->r3]]
[["Game 2: Bishop Diagonal"->r4]]
[["Game 3: Memory Challenge 1"->r7]]
Level: Difficult
[["Game 1: Knight Moves 1"->r5]]
[["Game 2: Knight Moves 2"->r6]]
[["Game 3: Memory Challenge 2"->r8]]
<<button "Settings" "menu">><</button>>Total Points: $points
Enter Your Name: <<textbox "$name" "" "menu">><<button "Add Name" "exit">><</button>>
<<set $name = $name.trim()>>
<<if $name eq "">>
<<set $name = "Anonymous" + random(1,9999)>>
<<endif>>
<<button "Back" "menu">><</button>><nav class="navigation">
<ul class="mainmenu">
<li>[["♛Square Colours"->level_1]]</li>
<li>[["♛Alien Capture"->aliencapture]]</li>
<li>[["♛Back"->welcome2]]</li>
</ul>
</nav>
<nav class="navigation">
<ul class="mainmenu">
<li>[["♛Bishop Diagonal"->level_3]]</li>
<li>[["♛Two Squares"->level_2]]</li>
<li>[["♛Memory I"->memory1]]</li>
<li>[["♛Back"->welcome2]]</li>
</ul>
</nav>
<nav class="navigation">
<ul class="mainmenu">
<li>[["♛Knight Moves 1"->knight]]</li>
<li>[["♛Knight Moves 2"->knight2]]</li>
<li>[["♛Memory Challenge 2"->memory2]]</li>
<li>[["♛Back"->welcome2]]</li>
</ul>
</nav><<set $knight_ans to "">>
<<set $sq1 to "">>\
<<set $square1 to random(1, 16)>>\
<<if $square1 is 1>><<set $sq1 to "a1">>\
<<elseif $square1 is 2>><<set $sq1 to "b1">>\
<<elseif $square1 is 3>><<set $sq1 to "c1">>\
<<elseif $square1 is 4>><<set $sq1 to "d1">>\
<<elseif $square1 is 5>><<set $sq1 to "e1">>\
<<elseif $square1 is 6>><<set $sq1 to "f1">>\
<<elseif $square1 is 7>><<set $sq1 to "g1">>\
<<elseif $square1 is 8>><<set $sq1 to "h1">>\
<<elseif $square1 is 9>><<set $sq1 to "h2">>\
<<elseif $square1 is 10>><<set $sq1 to "g2">>\
<<elseif $square1 is 11>><<set $sq1 to "f2">>\
<<elseif $square1 is 12>><<set $sq1 to "e2">>\
<<elseif $square1 is 13>><<set $sq1 to "d2">>\
<<elseif $square1 is 14>><<set $sq1 to "c2">>\
<<elseif $square1 is 15>><<set $sq1 to "b2">>\
<<elseif $square1 is 16>><<set $sq1 to "a2">>\
<</if>>\
<<set $sq2 to "">>\
<<set $square2 to random(49, 64)>>\
<<if $square2 is 49>><<set $sq2 to "a7">>\
<<elseif $square2 is 50>><<set $sq2 to "b7">>\
<<elseif $square2 is 51>><<set $sq2 to "c7">>\
<<elseif $square2 is 52>><<set $sq2 to "d7">>\
<<elseif $square2 is 53>><<set $sq2 to "e7">>\
<<elseif $square2 is 54>><<set $sq2 to "f7">>\
<<elseif $square2 is 55>><<set $sq2 to "g7">>\
<<elseif $square2 is 56>><<set $sq2 to "h7">>\
<<elseif $square2 is 57>><<set $sq2 to "h8">>\
<<elseif $square2 is 58>><<set $sq2 to "g8">>\
<<elseif $square2 is 59>><<set $sq2 to "f8">>\
<<elseif $square2 is 60>><<set $sq2 to "e8">>\
<<elseif $square2 is 61>><<set $sq2 to "d8">>\
<<elseif $square2 is 62>><<set $sq2 to "c8">>\
<<elseif $square2 is 63>><<set $sq2 to "b8">>\
<<elseif $square2 is 64>><<set $sq2 to "a8">>\
<</if>>
Square 1: $sq1
Square 2: $sq2
<<dropdown '$knight_ans' '1' '2' '3' '4' '5' '6' '7'>>
<<button GO "knight_ans">> <</button>>
<<if $clock eq 5>>
<div class="time-bar"><span class="w0"></span></div><<timed 5s>><<goto "timeout">><</timed>>
<<elseif $clock eq 10>>
<div class="time-bar"><span class="w1"></span></div>
<<timed 10s>><<goto "timeout">><</timed>>
<<elseif $clock eq 15>>
<div class="time-bar"><span class="w2"></span></div>
<<timed 15s>><<goto "timeout">><</timed>>
<<elseif $clock eq 30>>
<div class="time-bar"><span class="w3"></span></div>
<<timed 30s>><<goto "timeout">><</timed>>
<<elseif $clock eq 60>>
<div class="time-bar"><span class="w4"></span></div>
<<timed 60s>><<goto "timeout">><</timed>>
<<elseif $clock eq 120>>
<div class="time-bar"><span class="w5"></span></div>
<<timed 120s>><<goto "timeout">><</timed>>
<</if>>
<<audio "ticktock" play>>
<<audio "ticktock" loop>><<audio "ticktock" stop>>\
<<script>>
var square1 = State.variables.sq1;
var square2 = State.variables.sq2;
function findCoo(el) {
return [
el[1] - 1, // the row value - 1
el[0].codePointAt() - 'a'.codePointAt() // the column ascii value - ascii value of a
];
}
var [col1,row1] = findCoo(square1);
var [col2,row2] = findCoo(square2);
var krow = row1 - row2;
var kcol = col1 - col2;
var abskrow = (krow < 0) ? -krow : krow;
var abskcol = (kcol < 0) ? -kcol : kcol;
var knightmatrix = [
["0","3","2","3","2","3","4","5"],
["3","2","1","2","3","4","3","4"],
["2","1","4","3","2","3","4","5"],
["3","2","3","2","3","4","3","4"],
["2","3","2","3","4","3","4","5"],
["3","4","3","4","3","4","5","4"],
["4","3","4","3","4","5","4","5"],
["5","4","5","4","5","4","5","6"]]
var ans = knightmatrix[abskrow][abskcol]
setup.testFunction = function () {
return ans;
};
<</script>>
<<set $var to setup.testFunction()>>\
<<if $var is $knight_ans>>\
<<set $points to $points + 2>>
You got it right!
<<elseif $var neq $knight_ans>>\
<<set $points to $points - 1>>
Uh, oh. Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wN';
position[State.variables.sq2] = 'wX';
ChessBoard('board', position);
};
<</script>>
<</if>>
<<if $points lt 0>><<set $points to 0>><<endif>>\
<<button "Next Puzzle" "knight">><</button>>
Total Points: $points
<<button "Help" "r5">><</button>><<set $knight_ans to "">>
<<set $sq1 to "">>\
<<set $square1 to random(1, 8)>>\
<<if $square1 is 1>><<set $sq1 to "a1">>\
<<elseif $square1 is 2>><<set $sq1 to "b1">>\
<<elseif $square1 is 3>><<set $sq1 to "c1">>\
<<elseif $square1 is 4>><<set $sq1 to "d1">>\
<<elseif $square1 is 5>><<set $sq1 to "e1">>\
<<elseif $square1 is 6>><<set $sq1 to "f1">>\
<<elseif $square1 is 7>><<set $sq1 to "g1">>\
<<elseif $square1 is 8>><<set $sq1 to "h1">>\
<</if>>\
<<set $sq2 to "">>\
<<set $square2 to random(49, 64)>>
<<if $square2 is 49>><<set $sq2 to "a7">>\
<<elseif $square2 is 50>><<set $sq2 to "b7">>\
<<elseif $square2 is 51>><<set $sq2 to "c7">>\
<<elseif $square2 is 52>><<set $sq2 to "d7">>\
<<elseif $square2 is 53>><<set $sq2 to "e7">>\
<<elseif $square2 is 54>><<set $sq2 to "f7">>\
<<elseif $square2 is 55>><<set $sq2 to "g7">>\
<<elseif $square2 is 56>><<set $sq2 to "h7">>\
<<elseif $square2 is 57>><<set $sq2 to "h8">>\
<<elseif $square2 is 58>><<set $sq2 to "g8">>\
<<elseif $square2 is 59>><<set $sq2 to "f8">>\
<<elseif $square2 is 60>><<set $sq2 to "e8">>\
<<elseif $square2 is 61>><<set $sq2 to "d8">>\
<<elseif $square2 is 62>><<set $sq2 to "c8">>\
<<elseif $square2 is 63>><<set $sq2 to "b8">>\
<<elseif $square2 is 64>><<set $sq2 to "a8">>\
<</if>>\
<<set $sq3 to "">>\
<<set $square3 to random(9, 16)>>\
<<if $square3 is 9>><<set $sq3 to "h2">>\
<<elseif $square3 is 10>><<set $sq3 to "g2">>\
<<elseif $square3 is 11>><<set $sq3 to "f2">>\
<<elseif $square3 is 12>><<set $sq3 to "e2">>\
<<elseif $square3 is 13>><<set $sq3 to "d2">>\
<<elseif $square3 is 14>><<set $sq3 to "c2">>\
<<elseif $square3 is 15>><<set $sq3 to "b2">>\
<<elseif $square3 is 16>><<set $sq3 to "a2">>\
<</if>>
Square 1: $sq1
Square 2: $sq2
Square 3: $sq3
<<dropdown '$knight_ans' '1' '2' '3' '4' '5' '6' '7' '8' '9' '10' '11' '12' '13' '14' '15' '16' '17' '18'>>
<<button GO "knight2_ans">> <</button>>
<<if $clock eq 5>>
<div class="time-bar"><span class="w0"></span></div><<timed 5s>><<goto "timeout">><</timed>>
<<elseif $clock eq 10>>
<div class="time-bar"><span class="w1"></span></div>
<<timed 10s>><<goto "timeout">><</timed>>
<<elseif $clock eq 15>>
<div class="time-bar"><span class="w2"></span></div>
<<timed 15s>><<goto "timeout">><</timed>>
<<elseif $clock eq 30>>
<div class="time-bar"><span class="w3"></span></div>
<<timed 30s>><<goto "timeout">><</timed>>
<<elseif $clock eq 60>>
<div class="time-bar"><span class="w4"></span></div>
<<timed 60s>><<goto "timeout">><</timed>>
<<elseif $clock eq 120>>
<div class="time-bar"><span class="w5"></span></div>
<<timed 120s>><<goto "timeout">><</timed>>
<</if>>
<<audio "ticktock" play>>\
<<audio "ticktock" loop>>\<<audio "ticktock" stop>>\
<<script>>
var square1 = State.variables.sq1;
var square2 = State.variables.sq2;
var square3 = State.variables.sq3;
function findCoo(el) {
return [
el[1] - 1, // the row value - 1
el[0].codePointAt() - 'a'.codePointAt() // the column ascii value - ascii value of a
];
}
var [col1,row1] = findCoo(square1);
var [col2,row2] = findCoo(square2);
var [col3,row3] = findCoo(square3);
var krow = row1 - row2;
var kcol = col1 - col2;
var abskrow = (krow < 0) ? -krow : krow;
var abskcol = (kcol < 0) ? -kcol : kcol;
var krow2 = row2 - row3;
var kcol2 = col2 - col3;
var abskrow2 = (krow2 < 0) ? -krow2 : krow2;
var abskcol2 = (kcol2 < 0) ? -kcol2 : kcol2;
var knightmatrix = [
[0,3,2,3,2,3,4,5],
[3,2,1,2,3,4,3,4],
[2,1,4,3,2,3,4,5],
[3,2,3,2,3,4,3,4],
[2,3,2,3,4,3,4,5],
[3,4,3,4,3,4,5,4],
[4,3,4,3,4,5,4,5],
[5,4,5,4,5,4,5,6]]
var ans1 = knightmatrix[abskrow][abskcol]
var ans2 = knightmatrix[abskrow2][abskcol2]
var ans = ans1 + ans2
setup.testFunction = function () {
return ans;
};
<</script>>
<<set $var to setup.testFunction()>>\
<<if $var eq $knight_ans>>\
<<set $points to $points + 2.5>>\
Good! You got it right!
<<elseif $var neq $knight_ans>>
<<set $points to $points - 1>>\
Uh, oh. Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wN';
position[State.variables.sq2] = 'wX';
position[State.variables.sq3] = 'wX';
ChessBoard('board', position);
};
<</script>>
Square 1: $sq1 | Square 2: $sq2 | Square 3: $sq3\
<</if>>
<<button "Next Puzzle" "knight2">><</button>>
<<if $points lt 0>><<set $points to 0>><<endif>>\
Total Points: $points
<<button "Help" "r6">><</button>>How quickly can you capture the alien ?
<<set $knight_ans to "">>\
<<set $sq1 to "">>\
<<set $square1 to random(1, 16)>>\
<<if $square1 is 1>><<set $sq1 to "a1">>\
<<elseif $square1 is 2>><<set $sq1 to "b1">>\
<<elseif $square1 is 3>><<set $sq1 to "c1">>\
<<elseif $square1 is 4>><<set $sq1 to "d1">>\
<<elseif $square1 is 5>><<set $sq1 to "e1">>\
<<elseif $square1 is 6>><<set $sq1 to "f1">>\
<<elseif $square1 is 7>><<set $sq1 to "g1">>\
<<elseif $square1 is 8>><<set $sq1 to "h1">>\
<<elseif $square1 is 9>><<set $sq1 to "h2">>\
<<elseif $square1 is 10>><<set $sq1 to "g2">>\
<<elseif $square1 is 11>><<set $sq1 to "f2">>\
<<elseif $square1 is 12>><<set $sq1 to "e2">>\
<<elseif $square1 is 13>><<set $sq1 to "d2">>\
<<elseif $square1 is 14>><<set $sq1 to "c2">>\
<<elseif $square1 is 15>><<set $sq1 to "b2">>\
<<elseif $square1 is 16>><<set $sq1 to "a2">>\
<</if>>\
<<set $sq2 to "">>\
<<set $square2 to random(49, 64)>>\
<<if $square2 is 49>><<set $sq2 to "a7">>\
<<elseif $square2 is 50>><<set $sq2 to "b7">>\
<<elseif $square2 is 51>><<set $sq2 to "c7">>\
<<elseif $square2 is 52>><<set $sq2 to "d7">>\
<<elseif $square2 is 53>><<set $sq2 to "e7">>\
<<elseif $square2 is 54>><<set $sq2 to "f7">>\
<<elseif $square2 is 55>><<set $sq2 to "g7">>\
<<elseif $square2 is 56>><<set $sq2 to "h7">>\
<<elseif $square2 is 57>><<set $sq2 to "h8">>\
<<elseif $square2 is 58>><<set $sq2 to "g8">>\
<<elseif $square2 is 59>><<set $sq2 to "f8">>\
<<elseif $square2 is 60>><<set $sq2 to "e8">>\
<<elseif $square2 is 61>><<set $sq2 to "d8">>\
<<elseif $square2 is 62>><<set $sq2 to "c8">>\
<<elseif $square2 is 63>><<set $sq2 to "b8">>\
<<elseif $square2 is 64>><<set $sq2 to "a8">>\
<</if>>\
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'bN';
position[State.variables.sq2] = 'bX';
ChessBoard('board', position);
};
<</script>><<set $kill to "">>\
<<dropdown '$kill' '1' '2' '3' '4' '5' '6' >>Moves <<button "Capture" "aliencapture_ans">> <</button>>
<<if $clock eq 5>>
<div class="time-bar"><span class="w0"></span></div><<timed 5s>><<goto "timeout">><</timed>>
<<elseif $clock eq 10>>
<div class="time-bar"><span class="w1"></span></div>
<<timed 10s>><<goto "timeout">><</timed>>
<<elseif $clock eq 15>>
<div class="time-bar"><span class="w2"></span></div>
<<timed 15s>><<goto "timeout">><</timed>>
<<elseif $clock eq 30>>
<div class="time-bar"><span class="w3"></span></div>
<<timed 30s>><<goto "timeout">><</timed>>
<<elseif $clock eq 60>>
<div class="time-bar"><span class="w4"></span></div>
<<timed 60s>><<goto "timeout">><</timed>>
<<elseif $clock eq 120>>
<div class="time-bar"><span class="w5"></span></div>
<<timed 120s>><<goto "timeout">><</timed>>
<</if>>
<<audio "ticktock" play>>
<<audio "ticktock" loop>><<script>>
var square1 = State.variables.sq1;
var square2 = State.variables.sq2;
function findCoo(el) {
return [
el[1] - 1, // the row value - 1
el[0].codePointAt() - 'a'.codePointAt() // the column ascii value - ascii value of a
];
}
var [col1,row1] = findCoo(square1);
var [col2,row2] = findCoo(square2);
var krow = row1 - row2;
var kcol = col1 - col2;
var abskrow = (krow < 0) ? -krow : krow;
var abskcol = (kcol < 0) ? -kcol : kcol;
var knightmatrix = [
["0","3","2","3","2","3","4","5"],
["3","2","1","2","3","4","3","4"],
["2","1","4","3","2","3","4","5"],
["3","2","3","2","3","4","3","4"],
["2","3","2","3","4","3","4","5"],
["3","4","3","4","3","4","5","4"],
["4","3","4","3","4","5","4","5"],
["5","4","5","4","5","4","5","6"]]
var ans = knightmatrix[abskrow][abskcol]
setup.testFunction = function () {
return ans;
};
<</script>>\
<<set $var to setup.testFunction()>>\
<<if $var is $kill>>\
<<set $points to $points + 1>>\
Great! You got it right!
<<elseif $var neq $kill>>\
<<set $points to $points - 1>>\
Uh, oh. Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'bN';
position[State.variables.sq2] = 'bX';
ChessBoard('board', position);
};
<</script>>\
<</if>>\
<<if $points lt 0>><<set $points to 0>><<endif>>\
<<audio "ticktock" stop>>
<<button "Next Puzzle" "aliencapture">><</button>>
Total Points: $points
<<button "Help" "r2">><</button>>Game 1: Square Colours
Goal: Find out the colour of a given square.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wX';
ChessBoard('board', position);
};
<</script>>
<<button "Rules" "rules">><</button>><<button "Menu" "menu">><</button>>Game 2: Alien Capture
Goal: Find out the minimum number of moves it would take to capture the Alien.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'bN';
position[State.variables.sq2] = 'bX';
ChessBoard('board', position);
};
<</script>>
<<button "Rules" "rules">><</button>><<button "Menu" "menu">><</button>>Level: Medium
Game 1: Two Squares
Goal: Find out if the two squares are of the same colour. If they are same, click yes. If not, click No.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wX';
position[State.variables.sq2] = 'wX';
ChessBoard('board', position);
};
<</script>>
<<button "Rules" "rules">><</button>><<button "Menu" "menu">><</button>>Game 2: Bishop Diagonal
Goal: Find out if the two squares are on the same diagonal.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq2] = 'wX';
position[State.variables.sq3] = 'wX';
ChessBoard('board', position);
};
<</script>>
<<button "Rules" "rules">><</button>><<button "Menu" "menu">><</button>>Level: Difficult
Game 1: Knight Moves 1
Goal: Find out the minimum number of moves it would require for your knight to travel from square 1 to square 2.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wN';
position[State.variables.sq2] = 'wX';
ChessBoard('board', position);
};
<</script>>
<<button "Rules" "rules">><</button>><<button "Menu" "menu">><</button>>Game 2: Knight Moves 2
Goal: Find out the minimum number of moves it would require for your knight to travel from square 1 to square 2 to square 3. Remember, you should go from square 1 to square 2 to square 3 and not in any other order.
Example: $sq1 to $sq2 to $sq3
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wN';
position[State.variables.sq2] = 'wX';
position[State.variables.sq3] = 'wX';
ChessBoard('board', position);
};
<</script>>
<<button "Rules" "rules">><</button>><<button "Menu" "menu">><</button>><<audio "ticktock" stop>>\
Time out!
You lose one point.
<<set $points to $points - 1>>
<<if $points lt 0>><<set $points to 0>><<endif>>\
Total Score: $points
<<button "Play Again" "welcome2">> <</button>>
<<button "Timer Settings" "clock">> <</button>>Memorize the position:
<<set $knight to "">>\
<<set $sq1 to "">>\
<<set $bishop to "">>\
<<set $sq2 to "">>\
<<set $king to "">>\
<<set $sq3 to "">>\
<<set $rook to "">>\
<<set $sq4 to "">>\
<<set $knight to random(1,16)>>\
<<if $knight is 1>><<set $sq1 to "a1">>\
<<elseif $knight is 2>><<set $sq1 to "b1">>\
<<elseif $knight is 3>><<set $sq1 to "c1">>\
<<elseif $knight is 4>><<set $sq1 to "d1">>\
<<elseif $knight is 5>><<set $sq1 to "e1">>\
<<elseif $knight is 6>><<set $sq1 to "f1">>\
<<elseif $knight is 7>><<set $sq1 to "g1">>\
<<elseif $knight is 8>><<set $sq1 to "h1">>\
<<elseif $knight is 9>><<set $sq1 to "h2">>\
<<elseif $knight is 10>><<set $sq1 to "g2">>\
<<elseif $knight is 11>><<set $sq1 to "f2">>\
<<elseif $knight is 12>><<set $sq1 to "e2">>\
<<elseif $knight is 13>><<set $sq1 to "d2">>\
<<elseif $knight is 14>><<set $sq1 to "c2">>\
<<elseif $knight is 15>><<set $sq1 to "b2">>\
<<elseif $knight is 16>><<set $sq1 to "a2">>\
<<elseif $knight is 17>><<set $sq1 to "a3">>\
<<elseif $knight is 18>><<set $sq1 to "b3">>\
<<elseif $knight is 19>><<set $sq1 to "c3">>\
<<elseif $knight is 20>><<set $sq1 to "d3">>\
<<elseif $knight is 21>><<set $sq1 to "e3">>\
<<elseif $knight is 22>><<set $sq1 to "f3">>\
<<elseif $knight is 23>><<set $sq1 to "g3">>\
<<elseif $knight is 24>><<set $sq1 to "h3">>\
<<elseif $knight is 25>><<set $sq1 to "h4">>\
<<elseif $knight is 26>><<set $sq1 to "g4">>\
<<elseif $knight is 27>><<set $sq1 to "f4">>\
<<elseif $knight is 28>><<set $sq1 to "e4">>\
<<elseif $knight is 29>><<set $sq1 to "d4">>\
<<elseif $knight is 30>><<set $sq1 to "c4">>\
<<elseif $knight is 31>><<set $sq1 to "b4">>\
<<elseif $knight is 32>><<set $sq1 to "a4">>\
<<elseif $knight is 33>><<set $sq1 to "a5">>\
<<elseif $knight is 34>><<set $sq1 to "b5">>\
<<elseif $knight is 35>><<set $sq1 to "c5">>\
<<elseif $knight is 36>><<set $sq1 to "d5">>\
<<elseif $knight is 37>><<set $sq1 to "e5">>\
<<elseif $knight is 38>><<set $sq1 to "f5">>\
<<elseif $knight is 39>><<set $sq1 to "g5">>\
<<elseif $knight is 40>><<set $sq1 to "h5">>\
<<elseif $knight is 41>><<set $sq1 to "h6">>\
<<elseif $knight is 42>><<set $sq1 to "g6">>\
<<elseif $knight is 43>><<set $sq1 to "f6">>\
<<elseif $knight is 44>><<set $sq1 to "e6">>\
<<elseif $knight is 45>><<set $sq1 to "d6">>\
<<elseif $knight is 46>><<set $sq1 to "c6">>\
<<elseif $knight is 47>><<set $sq1 to "b6">>\
<<elseif $knight is 48>><<set $sq1 to "a6">>\
<<elseif $knight is 49>><<set $sq1 to "a7">>\
<<elseif $knight is 50>><<set $sq1 to "b7">>\
<<elseif $knight is 51>><<set $sq1 to "c7">>\
<<elseif $knight is 52>><<set $sq1 to "d7">>\
<<elseif $knight is 53>><<set $sq1 to "e7">>\
<<elseif $knight is 54>><<set $sq1 to "f7">>\
<<elseif $knight is 55>><<set $sq1 to "g7">>\
<<elseif $knight is 56>><<set $sq1 to "h7">>\
<<elseif $knight is 57>><<set $sq1 to "h8">>\
<<elseif $knight is 58>><<set $sq1 to "g8">>\
<<elseif $knight is 59>><<set $sq1 to "f8">>\
<<elseif $knight is 60>><<set $sq1 to "e8">>\
<<elseif $knight is 61>><<set $sq1 to "d8">>\
<<elseif $knight is 62>><<set $sq1 to "c8">>\
<<elseif $knight is 63>><<set $sq1 to "b8">>\
<<elseif $knight is 64>><<set $sq1 to "a8">>\
<</if>>\
<<set $bishop to random(17,32)>>\
<<if $bishop is 1>><<set $sq2 to "a1">>\
<<elseif $bishop is 2>><<set $sq2 to "b1">>\
<<elseif $bishop is 3>><<set $sq2 to "c1">>\
<<elseif $bishop is 4>><<set $sq2 to "d1">>\
<<elseif $bishop is 5>><<set $sq2 to "e1">>\
<<elseif $bishop is 6>><<set $sq2 to "f1">>\
<<elseif $bishop is 7>><<set $sq2 to "g1">>\
<<elseif $bishop is 8>><<set $sq2 to "h1">>\
<<elseif $bishop is 9>><<set $sq2 to "h2">>\
<<elseif $bishop is 10>><<set $sq2 to "g2">>\
<<elseif $bishop is 11>><<set $sq2 to "f2">>\
<<elseif $bishop is 12>><<set $sq2 to "e2">>\
<<elseif $bishop is 13>><<set $sq2 to "d2">>\
<<elseif $bishop is 14>><<set $sq2 to "c2">>\
<<elseif $bishop is 15>><<set $sq2 to "b2">>\
<<elseif $bishop is 16>><<set $sq2 to "a2">>\
<<elseif $bishop is 17>><<set $sq2 to "a3">>\
<<elseif $bishop is 18>><<set $sq2 to "b3">>\
<<elseif $bishop is 19>><<set $sq2 to "c3">>\
<<elseif $bishop is 20>><<set $sq2 to "d3">>\
<<elseif $bishop is 21>><<set $sq2 to "e3">>\
<<elseif $bishop is 22>><<set $sq2 to "f3">>\
<<elseif $bishop is 23>><<set $sq2 to "g3">>\
<<elseif $bishop is 24>><<set $sq2 to "h3">>\
<<elseif $bishop is 25>><<set $sq2 to "h4">>\
<<elseif $bishop is 26>><<set $sq2 to "g4">>\
<<elseif $bishop is 27>><<set $sq2 to "f4">>\
<<elseif $bishop is 28>><<set $sq2 to "e4">>\
<<elseif $bishop is 29>><<set $sq2 to "d4">>\
<<elseif $bishop is 30>><<set $sq2 to "c4">>\
<<elseif $bishop is 31>><<set $sq2 to "b4">>\
<<elseif $bishop is 32>><<set $sq2 to "a4">>\
<<elseif $bishop is 33>><<set $sq2 to "a5">>\
<<elseif $bishop is 34>><<set $sq2 to "b5">>\
<<elseif $bishop is 35>><<set $sq2 to "c5">>\
<<elseif $bishop is 36>><<set $sq2 to "d5">>\
<<elseif $bishop is 37>><<set $sq2 to "e5">>\
<<elseif $bishop is 38>><<set $sq2 to "f5">>\
<<elseif $bishop is 39>><<set $sq2 to "g5">>\
<<elseif $bishop is 40>><<set $sq2 to "h5">>\
<<elseif $bishop is 41>><<set $sq2 to "h6">>\
<<elseif $bishop is 42>><<set $sq2 to "g6">>\
<<elseif $bishop is 43>><<set $sq2 to "f6">>\
<<elseif $bishop is 44>><<set $sq2 to "e6">>\
<<elseif $bishop is 45>><<set $sq2 to "d6">>\
<<elseif $bishop is 46>><<set $sq2 to "c6">>\
<<elseif $bishop is 47>><<set $sq2 to "b6">>\
<<elseif $bishop is 48>><<set $sq2 to "a6">>\
<<elseif $bishop is 49>><<set $sq2 to "a7">>\
<<elseif $bishop is 50>><<set $sq2 to "b7">>\
<<elseif $bishop is 51>><<set $sq2 to "c7">>\
<<elseif $bishop is 52>><<set $sq2 to "d7">>\
<<elseif $bishop is 53>><<set $sq2 to "e7">>\
<<elseif $bishop is 54>><<set $sq2 to "f7">>\
<<elseif $bishop is 55>><<set $sq2 to "g7">>\
<<elseif $bishop is 56>><<set $sq2 to "h7">>\
<<elseif $bishop is 57>><<set $sq2 to "h8">>\
<<elseif $bishop is 58>><<set $sq2 to "g8">>\
<<elseif $bishop is 59>><<set $sq2 to "f8">>\
<<elseif $bishop is 60>><<set $sq2 to "e8">>\
<<elseif $bishop is 61>><<set $sq2 to "d8">>\
<<elseif $bishop is 62>><<set $sq2 to "c8">>\
<<elseif $bishop is 63>><<set $sq2 to "b8">>\
<<elseif $bishop is 64>><<set $sq2 to "a8">>\
<</if>>\
<<set $king to random(33,48)>>\
<<if $king is 1>><<set $sq3 to "a1">>\
<<elseif $king is 2>><<set $sq3 to "b1">>\
<<elseif $king is 3>><<set $sq3 to "c1">>\
<<elseif $king is 4>><<set $sq3 to "d1">>\
<<elseif $king is 5>><<set $sq3 to "e1">>\
<<elseif $king is 6>><<set $sq3 to "f1">>\
<<elseif $king is 7>><<set $sq3 to "g1">>\
<<elseif $king is 8>><<set $sq3 to "h1">>\
<<elseif $king is 9>><<set $sq3 to "h2">>\
<<elseif $king is 10>><<set $sq3 to "g2">>\
<<elseif $king is 11>><<set $sq3 to "f2">>\
<<elseif $king is 12>><<set $sq3 to "e2">>\
<<elseif $king is 13>><<set $sq3 to "d2">>\
<<elseif $king is 14>><<set $sq3 to "c2">>\
<<elseif $king is 15>><<set $sq3 to "b2">>\
<<elseif $king is 16>><<set $sq3 to "a2">>\
<<elseif $king is 17>><<set $sq3 to "a3">>\
<<elseif $king is 18>><<set $sq3 to "b3">>\
<<elseif $king is 19>><<set $sq3 to "c3">>\
<<elseif $king is 20>><<set $sq3 to "d3">>\
<<elseif $king is 21>><<set $sq3 to "e3">>\
<<elseif $king is 22>><<set $sq3 to "f3">>\
<<elseif $king is 23>><<set $sq3 to "g3">>\
<<elseif $king is 24>><<set $sq3 to "h3">>\
<<elseif $king is 25>><<set $sq3 to "h4">>\
<<elseif $king is 26>><<set $sq3 to "g4">>\
<<elseif $king is 27>><<set $sq3 to "f4">>\
<<elseif $king is 28>><<set $sq3 to "e4">>\
<<elseif $king is 29>><<set $sq3 to "d4">>\
<<elseif $king is 30>><<set $sq3 to "c4">>\
<<elseif $king is 31>><<set $sq3 to "b4">>\
<<elseif $king is 32>><<set $sq3 to "a4">>\
<<elseif $king is 33>><<set $sq3 to "a5">>\
<<elseif $king is 34>><<set $sq3 to "b5">>\
<<elseif $king is 35>><<set $sq3 to "c5">>\
<<elseif $king is 36>><<set $sq3 to "d5">>\
<<elseif $king is 37>><<set $sq3 to "e5">>\
<<elseif $king is 38>><<set $sq3 to "f5">>\
<<elseif $king is 39>><<set $sq3 to "g5">>\
<<elseif $king is 40>><<set $sq3 to "h5">>\
<<elseif $king is 41>><<set $sq3 to "h6">>\
<<elseif $king is 42>><<set $sq3 to "g6">>\
<<elseif $king is 43>><<set $sq3 to "f6">>\
<<elseif $king is 44>><<set $sq3 to "e6">>\
<<elseif $king is 45>><<set $sq3 to "d6">>\
<<elseif $king is 46>><<set $sq3 to "c6">>\
<<elseif $king is 47>><<set $sq3 to "b6">>\
<<elseif $king is 48>><<set $sq3 to "a6">>\
<<elseif $king is 49>><<set $sq3 to "a7">>\
<<elseif $king is 50>><<set $sq3 to "b7">>\
<<elseif $king is 51>><<set $sq3 to "c7">>\
<<elseif $king is 52>><<set $sq3 to "d7">>\
<<elseif $king is 53>><<set $sq3 to "e7">>\
<<elseif $king is 54>><<set $sq3 to "f7">>\
<<elseif $king is 55>><<set $sq3 to "g7">>\
<<elseif $king is 56>><<set $sq3 to "h7">>\
<<elseif $king is 57>><<set $sq3 to "h8">>\
<<elseif $king is 58>><<set $sq3 to "g8">>\
<<elseif $king is 59>><<set $sq3 to "f8">>\
<<elseif $king is 60>><<set $sq3 to "e8">>\
<<elseif $king is 61>><<set $sq3 to "d8">>\
<<elseif $king is 62>><<set $sq3 to "c8">>\
<<elseif $king is 63>><<set $sq3 to "b8">>\
<<elseif $king is 64>><<set $sq3 to "a8">>\
<</if>>\
<<set $rook to random(49,64)>>\
<<if $rook is 1>><<set $sq4 to "a1">>\
<<elseif $rook is 2>><<set $sq4 to "b1">>\
<<elseif $rook is 3>><<set $sq4 to "c1">>\
<<elseif $rook is 4>><<set $sq4 to "d1">>\
<<elseif $rook is 5>><<set $sq4 to "e1">>\
<<elseif $rook is 6>><<set $sq4 to "f1">>\
<<elseif $rook is 7>><<set $sq4 to "g1">>\
<<elseif $rook is 8>><<set $sq4 to "h1">>\
<<elseif $rook is 9>><<set $sq4 to "h2">>\
<<elseif $rook is 10>><<set $sq4 to "g2">>\
<<elseif $rook is 11>><<set $sq4 to "f2">>\
<<elseif $rook is 12>><<set $sq4 to "e2">>\
<<elseif $rook is 13>><<set $sq4 to "d2">>\
<<elseif $rook is 14>><<set $sq4 to "c2">>\
<<elseif $rook is 15>><<set $sq4 to "b2">>\
<<elseif $rook is 16>><<set $sq4 to "a2">>\
<<elseif $rook is 17>><<set $sq4 to "a3">>\
<<elseif $rook is 18>><<set $sq4 to "b3">>\
<<elseif $rook is 19>><<set $sq4 to "c3">>\
<<elseif $rook is 20>><<set $sq4 to "d3">>\
<<elseif $rook is 21>><<set $sq4 to "e3">>\
<<elseif $rook is 22>><<set $sq4 to "f3">>\
<<elseif $rook is 23>><<set $sq4 to "g3">>\
<<elseif $rook is 24>><<set $sq4 to "h3">>\
<<elseif $rook is 25>><<set $sq4 to "h4">>\
<<elseif $rook is 26>><<set $sq4 to "g4">>\
<<elseif $rook is 27>><<set $sq4 to "f4">>\
<<elseif $rook is 28>><<set $sq4 to "e4">>\
<<elseif $rook is 29>><<set $sq4 to "d4">>\
<<elseif $rook is 30>><<set $sq4 to "c4">>\
<<elseif $rook is 31>><<set $sq4 to "b4">>\
<<elseif $rook is 32>><<set $sq4 to "a4">>\
<<elseif $rook is 33>><<set $sq4 to "a5">>\
<<elseif $rook is 34>><<set $sq4 to "b5">>\
<<elseif $rook is 35>><<set $sq4 to "c5">>\
<<elseif $rook is 36>><<set $sq4 to "d5">>\
<<elseif $rook is 37>><<set $sq4 to "e5">>\
<<elseif $rook is 38>><<set $sq4 to "f5">>\
<<elseif $rook is 39>><<set $sq4 to "g5">>\
<<elseif $rook is 40>><<set $sq4 to "h5">>\
<<elseif $rook is 41>><<set $sq4 to "h6">>\
<<elseif $rook is 42>><<set $sq4 to "g6">>\
<<elseif $rook is 43>><<set $sq4 to "f6">>\
<<elseif $rook is 44>><<set $sq4 to "e6">>\
<<elseif $rook is 45>><<set $sq4 to "d6">>\
<<elseif $rook is 46>><<set $sq4 to "c6">>\
<<elseif $rook is 47>><<set $sq4 to "b6">>\
<<elseif $rook is 48>><<set $sq4 to "a6">>\
<<elseif $rook is 49>><<set $sq4 to "a7">>\
<<elseif $rook is 50>><<set $sq4 to "b7">>\
<<elseif $rook is 51>><<set $sq4 to "c7">>\
<<elseif $rook is 52>><<set $sq4 to "d7">>\
<<elseif $rook is 53>><<set $sq4 to "e7">>\
<<elseif $rook is 54>><<set $sq4 to "f7">>\
<<elseif $rook is 55>><<set $sq4 to "g7">>\
<<elseif $rook is 56>><<set $sq4 to "h7">>\
<<elseif $rook is 57>><<set $sq4 to "h8">>\
<<elseif $rook is 58>><<set $sq4 to "g8">>\
<<elseif $rook is 59>><<set $sq4 to "f8">>\
<<elseif $rook is 60>><<set $sq4 to "e8">>\
<<elseif $rook is 61>><<set $sq4 to "d8">>\
<<elseif $rook is 62>><<set $sq4 to "c8">>\
<<elseif $rook is 63>><<set $sq4 to "b8">>\
<<elseif $rook is 64>><<set $sq4 to "a8">>\
<</if>>\
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wN';
position[State.variables.sq2] = 'wB';
position[State.variables.sq3] = 'wK';
position[State.variables.sq4] = 'wR';
ChessBoard('board', position);
};
<</script>>
<div class="time-bar"><span class="w1"></span></div>
<<timed 10s>><<goto "memoryq">><</timed>>
<<audio "ticktock" play>>
<<audio "ticktock" loop>><<set $file1 to "">><<set $rank1 to "">>\
<<set $file2 to "">><<set $rank2 to "">>\
<<set $file3 to "">><<set $rank3 to "">>\
<<set $file4 to "">><<set $rank4 to "">>\
White King:
<<dropdown '$file3' 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h'>><<dropdown '$rank3' '1' '2' '3' '4' '5' '6' '7' '8'>>
White Rook:
<<dropdown '$file4' 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h'>><<dropdown '$rank4' '1' '2' '3' '4' '5' '6' '7' '8'>>
White Knight:
<<dropdown '$file1' 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h'>><<dropdown '$rank1' '1' '2' '3' '4' '5' '6' '7' '8'>>
White Bishop:
<<dropdown '$file2' 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h'>><<dropdown '$rank2' '1' '2' '3' '4' '5' '6' '7' '8'>>
<<button GO "memorya">> <</button>>
<<audio "ticktock" stop>><<audio "ticktock" stop>>\
<<set $p1 to $file1 + $rank1 + $file2 + $rank2 + $file3 + $rank3 + $file4 + $rank4>>\
<<set $a1 to $sq1 + $sq2 + $sq3 + $sq4>>\
<<if $p1 is $a1>>\
<<set $points to $points + 1.5>>\
Success!
<<elseif $p1 neq $a1>>
<<set $points to $points - 1>>\
Wrong Answer.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wN';
position[State.variables.sq2] = 'wB';
position[State.variables.sq3] = 'wK';
position[State.variables.sq4] = 'wR';
ChessBoard('board', position);
};
<</script>>\
<</if>>\
<<if $points lt 0>><<set $points to 0>><<endif>>\
<<button "Next Puzzle" "memory1">><</button>>
Total Points: $points
<<button "Help" "r7">><</button>>Game 3: Memory I
Goal: Memorize the given position. This level contains 4 pieces - King, Rook, Bishop & Knight. Set the square name for each piece in the respected dropdown field. This exercise has a fixed timer setting of ten seconds designed to challenge your short term memory.
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
var position = {};
position[State.variables.sq1] = 'wN';
position[State.variables.sq2] = 'wB';
position[State.variables.sq3] = 'wK';
position[State.variables.sq4] = 'wR';
ChessBoard('board', position);
};
<</script>>
<<button "Rules" "rules">><</button>><<button "Menu" "menu">><</button>>Memorize the position:
<<set $rp to random(1,20)>>\
<<set $posfen to "">>\
<<if $rp is 1>>\
<<set $posfen to "2K5/8/p4P2/k3p3/7p/8/1n6/7B">>\
<<elseif $rp is 2>>\
<<set $posfen to "6N1/5K2/8/4R3/8/1nk5/BN2p3/8">>\
<<elseif $rp is 3>>\
<<set $posfen to "8/2B5/N2p4/4R3/1p6/6Kp/8/5k2">>\
<<elseif $rp is 4>>\
<<set $posfen to "6N1/5K2/8/4R3/8/1nk5/BN2p3/8">>\
<<elseif $rp is 5>>\
<<set $posfen to "3N4/1p6/8/5k2/8/P3P3/n1b1K3/8">>\
<<elseif $rp is 6>>\
<<set $posfen to "6k1/2B3p1/P1K5/8/8/2p2n2/4p1N1/8">>\
<<elseif $rp is 7>>\
<<set $posfen to "8/8/P7/8/3k4/4r2p/8/2K5">>\
<<elseif $rp is 8>>\
<<set $posfen to "3N4/8/6K1/p1p5/8/5pPP/8/3k4">>\
<<elseif $rp is 9>>\
<<set $posfen to "8/8/1P6/1p2N3/4k3/5p1n/4p3/K7">>\
<<elseif $rp is 10>>\
<<set $posfen to "6r1/8/4B3/6pp/1b1K4/5k2/4p3/8">>\
<<elseif $rp is 11>>\
<<set $posfen to "2R5/1p6/7b/8/8/3K2k1/6np/R7">>\
<<elseif $rp is 12>>\
<<set $posfen to "8/2Bp4/6k1/1pp5/8/2p5/4p3/2K5">>\
<<elseif $rp is 13>>\
<<set $posfen to "6b1/8/5p1p/5k2/4R3/1p6/1KP5/8">>\
<<elseif $rp is 14>>\
<<set $posfen to "2R5/4p2p/8/8/4Kp2/4B3/6n1/5k2">>\
<<elseif $rp is 15>>\
<<set $posfen to "4r3/8/6P1/8/2p1k1bK/7p/8/6n1">>\
<<elseif $rp is 16>>\
<<set $posfen to "6r1/8/4k3/K7/pn6/3p4/3P4/6N1">>\
<<elseif $rp is 17>>\
<<set $posfen to "3B3K/5P2/4p1k1/6p1/8/8/7b/7B">>\
<<elseif $rp is 18>>\
<<set $posfen to "4B3/2P5/8/3P4/8/6pR/N7/4k1K1">>\
<<elseif $rp is 19>>\
<<set $posfen to "8/8/2k1P2B/5N2/7r/4K2B/7n/8">>\
<<elseif $rp is 20>>\
<<set $posfen to "8/n7/7B/2K5/1p6/8/p3kP2/3R4">>\
<</if>>\
<div id="board" style="width: 400px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
ChessBoard('board', {
position : State.variables.posfen
});
};
<</script>>
<<if $clock eq 5>>\
<div class="time-bar"><span class="w0"></span></div><<timed 5s>><<goto "rp_ans">><</timed>>\
<<elseif $clock eq 10>>\
<div class="time-bar"><span class="w1"></span></div>\
<<timed 10s>><<goto "rp_ans">><</timed>>\
<<elseif $clock eq 15>>\
<div class="time-bar"><span class="w2"></span></div>\
<<timed 15s>><<goto "rp_ans">><</timed>>\
<<elseif $clock eq 30>>\
<div class="time-bar"><span class="w3"></span></div>\
<<timed 30s>><<goto "rp_ans">><</timed>>\
<<elseif $clock eq 60>>\
<div class="time-bar"><span class="w4"></span></div>\
<<timed 60s>><<goto "rp_ans">><</timed>>\
<<elseif $clock eq 120>>\
<div class="time-bar"><span class="w5"></span></div>\
<<timed 120s>><<goto "rp_ans">><</timed>>\
<</if>>\
<<audio "ticktock" play>>
<<audio "ticktock" loop>>
<<audio "ticktock" stop>>\
Set Position:
<div id="board" style="width: 400px"></div>
<button id="positionBtn">Check Answer</button>
<<script>>
postdisplay['init-chess-board'] = function(taskName) {
delete postdisplay[taskName]; // single-use task
// Set up the board.
var board = ChessBoard('board', {
draggable : true,
dropOffBoard : 'trash',
sparePieces : true
});
// Set up some utility functions.
function getPosition() {
State.variables['position'] = board.position();
State.variables['fen'] = board.fen();
state.display("rp_validate", this);
}
// Attach event handlers to the buttons
$('#positionBtn').on('click', getPosition);
};
<</script>>
<<if $rp is 1 and $fen is "2K5/8/p4P2/k3p3/7p/8/1n6/7B">>
<<goto "rp_win">>
<<elseif $rp is 1 and $fen neq "2K5/8/p4P2/k3p3/7p/8/1n6/7B">>
<<goto "rp_loss">>
<<elseif $rp is 2 and $fen is "6N1/5K2/8/4R3/8/1nk5/BN2p3/8">>
<<goto "rp_win">>
<<elseif $rp is 2 and $fen neq "6N1/5K2/8/4R3/8/1nk5/BN2p3/8">>
<<goto "rp_loss">>
<<elseif $rp is 3 and $fen is "8/2B5/N2p4/4R3/1p6/6Kp/8/5k2">>
<<goto "rp_win">>
<<elseif $rp is 3 and $fen neq "8/2B5/N2p4/4R3/1p6/6Kp/8/5k2">>
<<goto "rp_loss">>
<<elseif $rp is 4 and $fen is "6N1/5K2/8/4R3/8/1nk5/BN2p3/8">>
<<goto "rp_win">>
<<elseif $rp is 4 and $fen neq "6N1/5K2/8/4R3/8/1nk5/BN2p3/8">>
<<goto "rp_loss">>
<<elseif $rp is 5 and $fen is "3N4/1p6/8/5k2/8/P3P3/n1b1K3/8">>
<<goto "rp_win">>
<<elseif $rp is 5 and $fen neq "3N4/1p6/8/5k2/8/P3P3/n1b1K3/8">>
<<goto "rp_loss">>
<<elseif $rp is 6 and $fen is "6k1/2B3p1/P1K5/8/8/2p2n2/4p1N1/8">>
<<goto "rp_win">>
<<elseif $rp is 6 and $fen neq "6k1/2B3p1/P1K5/8/8/2p2n2/4p1N1/8">>
<<goto "rp_loss">>
<<elseif $rp is 7 and $fen is "8/8/P7/8/3k4/4r2p/8/2K5">>
<<goto "rp_win">>
<<elseif $rp is 7 and $fen neq "8/8/P7/8/3k4/4r2p/8/2K5">>
<<goto "rp_loss">>
<<elseif $rp is 8 and $fen is "3N4/8/6K1/p1p5/8/5pPP/8/3k4">>
<<goto "rp_win">>
<<elseif $rp is 8 and $fen neq "3N4/8/6K1/p1p5/8/5pPP/8/3k4">>
<<goto "rp_loss">>
<<elseif $rp is 9 and $fen is "8/8/1P6/1p2N3/4k3/5p1n/4p3/K7">>
<<goto "rp_win">>
<<elseif $rp is 9 and $fen neq "8/8/1P6/1p2N3/4k3/5p1n/4p3/K7">>
<<goto "rp_loss">>
<<elseif $rp is 10 and $fen is "6r1/8/4B3/6pp/1b1K4/5k2/4p3/8">>
<<goto "rp_win">>
<<elseif $rp is 10 and $fen neq "6r1/8/4B3/6pp/1b1K4/5k2/4p3/8">>
<<goto "rp_loss">>
<<elseif $rp is 11 and $fen is "2R5/1p6/7b/8/8/3K2k1/6np/R7">>
<<goto "rp_win">>
<<elseif $rp is 11 and $fen neq "2R5/1p6/7b/8/8/3K2k1/6np/R7">>
<<goto "rp_loss">>
<<elseif $rp is 12 and $fen is "8/2Bp4/6k1/1pp5/8/2p5/4p3/2K5">>
<<goto "rp_win">>
<<elseif $rp is 12 and $fen neq "8/2Bp4/6k1/1pp5/8/2p5/4p3/2K5">>
<<goto "rp_loss">>
<<elseif $rp is 13 and $fen is "6b1/8/5p1p/5k2/4R3/1p6/1KP5/8">>
<<goto "rp_win">>
<<elseif $rp is 13 and $fen neq "6b1/8/5p1p/5k2/4R3/1p6/1KP5/8">>
<<goto "rp_loss">>
<<elseif $rp is 14 and $fen is "2R5/4p2p/8/8/4Kp2/4B3/6n1/5k2">>
<<goto "rp_win">>
<<elseif $rp is 14 and $fen neq "2R5/4p2p/8/8/4Kp2/4B3/6n1/5k2">>
<<goto "rp_loss">>
<<elseif $rp is 15 and $fen is "4r3/8/6P1/8/2p1k1bK/7p/8/6n1">>
<<goto "rp_win">>
<<elseif $rp is 15 and $fen neq "4r3/8/6P1/8/2p1k1bK/7p/8/6n1">>
<<goto "rp_loss">>
<<elseif $rp is 16 and $fen is "6r1/8/4k3/K7/pn6/3p4/3P4/6N1">>
<<goto "rp_win">>
<<elseif $rp is 16 and $fen neq "6r1/8/4k3/K7/pn6/3p4/3P4/6N1">>
<<goto "rp_loss">>
<<elseif $rp is 17 and $fen is "3B3K/5P2/4p1k1/6p1/8/8/7b/7B">>
<<goto "rp_win">>
<<elseif $rp is 17 and $fen neq "3B3K/5P2/4p1k1/6p1/8/8/7b/7B">>
<<goto "rp_loss">>
<<elseif $rp is 18 and $fen is "4B3/2P5/8/3P4/8/6pR/N7/4k1K1">>
<<goto "rp_win">>
<<elseif $rp is 18 and $fen neq "4B3/2P5/8/3P4/8/6pR/N7/4k1K1">>
<<goto "rp_loss">>
<<elseif $rp is 19 and $fen is "8/8/2k1P2B/5N2/7r/4K2B/7n/8">>
<<goto "rp_win">>
<<elseif $rp is 19 and $fen neq "8/8/2k1P2B/5N2/7r/4K2B/7n/8">>
<<goto "rp_loss">>
<<elseif $rp is 20 and $fen is "8/n7/7B/2K5/1p6/8/p3kP2/3R4">>
<<goto "rp_win">>
<<elseif $rp is 20 and $fen neq "8/n7/7B/2K5/1p6/8/p3kP2/3R4">>
<<goto "rp_loss">>
<</if>>
<<set $points to $points + 3>>\
Correct!
<<button "Next Puzzle" "memory2">><</button>>
<<if $points lt 0>><<set $points to 0>><<endif>>\
Total Points: $points
<<button "Help" "r8">><</button>><<set $points to $points - 1>>\
Wrong Answer!
<div id="board" style="width: 400px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
ChessBoard('board', {
position : State.variables.posfen
});
};
<</script>>
<<button "Next Puzzle" "memory2">><</button>>
<<if $points lt 0>><<set $points to 0>><<endif>>\
Total Points: $points
<<button "Help" "r8">><</button>>Hard: Memory Challenge 2
Goal: Memorize the given position. This level contains at least 8 pieces - King, Rook, Bishop, Knight & Pawns. Change timer settings if you find the level difficult.
<div id="board" style="width: 300px"></div>\
<div id="board" style="width: 300px"></div>\
<<script>>
postdisplay['init-chess-board'] = function (taskName) {
delete postdisplay[taskName]; // single-use task
ChessBoard('board', {
position : '2K5/8/p4P2/k3p3/7p/8/1n6/7B'
});
};
<</script>>
<<button "Rules" "rules">><</button>><<button "Menu" "menu">><</button>>Hey :)
Thanks for trying out Ghost Pieces app. My name is Arun, and I teach chess at Pondicherry, a small coastal city in southern India. From my personal experience as a coach, I find that the ability to visualize moves clearly and a strong short-term memory (remember where you parked your car or kept that house key?) form a strong fundamental basis for the skill of calculation. I learned a bit of programming and with help from open source communities, I was able to design (and continuously improve) this app. I hope that this little piece of programme will help you get better at calculation. My best wishes :)
If you find any bug or would like to suggest features, feel free to contact me at arunjchess@gmail.com
Also, it would be great if you can leave a review on play store! <a href="https://play.google.com/store/apps/details?id=ghost.pieces.free">Visit Play Store</a>
Thank you!
<<button "Back" "menu">><</button>>