Loading…
None
String updated in the repository |
|
None
String updated in the repository |
|
Loading…
None
String updated in the repository |
|
None
String updated in the repository |
|
This time, we compare the number of loops to the board's width. We go through the loop until we reach the width of the board.
Note that we move the robot until its position is one less than the board's width because we are counting tiles from [code]0[/code].
A board of [code]3[/code] by [code]3[/code] cells would have cell coordinates going from [code]0[/code] to [code]2[/code] on both the X and Y axes.
Esta vez, comparamos el número de bucles con el ancho del tablero. Seguimos haciendo bucles hasta alcanzar el ancho del tablero.
Ten en cuenta que nos movemos uno menos que el ancho del tablero porque el robot ya está en la primera celda.
Un tablero de [code]3[/code] por [code]3[/code] celdas tendría unas coordenadas de celda que irían de [code]0[/code] a [code]2[/code] en los ejes X e Y.