Class HtmlDisplay

java.lang.Object
edu.wisc.game.sql.HtmlDisplay

public class HtmlDisplay extends Object
Drawing boards in HTML. Buttons: with some inspiration from https://stackoverflow.com/questions/63846699/how-do-i-keep-the-selected-button-highlighted

For the buttons etc to work correctly, the HTML page into which this code is included should also include the JS snippet from js/boardDisplay.js

  • Constructor Details

    • HtmlDisplay

      public HtmlDisplay()
  • Method Details

    • htmlDisplay

      public static String htmlDisplay(Piece[] pieces, int lastMovePos, boolean weShowAllMovables, boolean[] isMoveable, int cellWidth, boolean canMove)
      Parameters:
      pieces - An array of N*N values, with nulls for empty cells
      canMove - If true, the player can make a move, so buttons will be enabled
    • notation

      public static String notation(boolean weShowAllMovables)