and
should draw these boards:


The task is complex, so build specialists that accomplish part of the task and then put them together. For example, you might start by building:
, which takes a size and draws one square.
, which uses
to draw one row of tiles, like this: 
, which uses
to draw as many rows as needed—the same number of rows as there are tiles in each row.
which can be used in
to make sure the entire board fits. (In the example, 3 tiles means three tiles on each row (and three rows), not three tiles altogether.)Test each block by itself before building a block that uses it.
Your top-level board-drawing block, draw n-by-n board, might look something like this.
.
Abstraction: Why building the block clear and go to starting place, when all it contains is a few commands to assure that the sprite starts in the right place, pointed the right way, with its pen down, and that the stages is cleared?
One purpose of hiding the details is to make your code clear, understandable, and easy to debug and update. Instead of seeing the details and wondering what they are for, you know exactly what this piece of code does just by reading the block's name.
The same is true of
. Instead of building that block, you could have used
—you can make those changes in a logical place rather than looking all over your program to find where the change might be needed.
that uses your between? block to report true if the sprite is on the board, and reports false if the sprite is dragged completely off the board.which cell? that tells which cell the sprite has been dragged into.
Here is one way to do it that uses two other blocks that specialize in reporting which column? and which row? the sprite is in.
 without computation.png)
These blocks will, of course, need to know how many rows and columns there were, so they'll need the input n.
which row? and which column? You can, of course, use lots of if statements, but since the number of rows can change, it's hard to know how many to use. One convenient way is to divide the total size of the game board by the size of each cell. To use that result, you need to round down.
can do it, but it rounds to the nearest integer, up or down. The function
always rounds down, making it easier to use. The floor function is in the same block as sqrt.

move to tile (n) that takes a tile number as input and moves your sprite to the center of that tile. Because the location of tile 9 depends on how many tiles there are, your move to tile block will need to know the size of the board.mark tile (n) to move to the specified tile and
the sprite's shape on that tile to mark it as "taken."