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 );
    }
}
@@ -26,12 +26,12 @@
 tor(
-x, y
+r, c
 , s)
@@ -54,13 +54,13 @@
 his.
-x = x
+r = r
 ;%0A  
@@ -74,13 +74,13 @@
 his.
-y = y
+c = c
 ;%0A  
@@ -136,12 +136,16 @@
     
-draw
+getColor
 ()%0A 
@@ -205,17 +205,18 @@
    case 
-0
+-1
 :%0A      
@@ -229,46 +229,22 @@
     
-fill( 'white' );%0A                break
+return 'gray' 
 ;%0A  
@@ -250,33 +250,32 @@
            case 
--
 1:%0A             
@@ -281,22 +281,22 @@
     
-fill( 'gray
+return 'blue
 ' 
-)
 ;%0A  
@@ -309,38 +309,48 @@
     
-    break;%0A            case 1:
+default:%0A                return 'white';
 %0A   
@@ -354,24 +354,26 @@
         
+%7D%0A
         
 fill( 'b
@@ -368,56 +368,143 @@
     
-fill( 'blue' );%0A                break;%0A        %7D
+let x = padding + this.c * this.s;%0A        let y = padding + this.r * this.s;%0A        text(%60($%7Bthis.r%7D,$%7Bthis.c%7D)%60, x, y + textSize() )
 %0A   
@@ -517,21 +517,11 @@
 ect(
-this.x, this.
+x, 
 y, t

change draw to return color based on state