• Monday - Tuesday morning: use D3js to draw a chess board on Codepen
  • Tuesday afternoon: move chess pieces -> add new key-value pair to board array so that each <text> has an unique id corresponding to each box (from #s0 to #s63).

move() takes 2 parameters: id of the initial box and id of the destination box. The function change the text content of the boxes. The initial box text becomes none while the code of the chess piece is added to the destination box text.

  • Wednesday - Thursday: continue with chess board. 2 versions

  • V1: loop through rows and columns -> append new rect and text

  • V2: a board array of 64 elements -> bind data and append new elements. <rect> and <text> grouped as a pair inside a <g>

  • Drag chess pieces with D3js: use d3 v4 and d3-drag.v1.min.js to set drag behaviour (differences between d3 v3 and d3 v4: origin() no longer works, use subject() to solve jumping issue when selecting a chess piece)
  • TODO: make <rect> catch events when a piece is moved over it and drop chess pieces so as to replace existing ones in the <rect>
  • Thursday afternoon: N-queens problems
  • TODO: how to find solutions and set up games

results matching ""

    No results matching ""