old_contents: class Tile
  {
      constructor(x, y, s)
      {
          this.x = x;
          this.y = y;
          this.s = s;
          this.state = 0;
      }
  
      draw()
      {
          switch( this.state )
          {
              case 0:
                  fill( 'white' );
                  break;
              case -1:
                  fill( 'gray' );
                  break;
              case 1:
                  fill( 'blue' );
                  break;
          }
          rect(this.x, this.y, this.s, this.s );
      }
  }
new_contents: class Tile
  {
      constructor(r, c, s)
      {
          this.r = r;
          this.c = c;
          this.s = s;
          this.state = 0;
      }
  
      getColor()
      {
          switch( this.state )
          {
              case -1:
                  return 'gray' ;
              case 1:
                  return 'blue' ;
              default:
                  return 'white';
          }
          let x = padding + this.c * this.s;
          let y = padding + this.r * this.s;
          text(`(${this.r},${this.c})`, x, y + textSize() )
          rect(x, y, this.s, this.s );
      }
  }
subject: change draw to return color based on state