We want a function to draw squares of any size. We could use these squares as outlines when selecting units in a tactical game, as a frame for items in an inventory, and more. Create a function named [code]draw_square()[/code] that takes one parameter: the [code]length[/code] of the square's sides. [b]The turtle should face towards the right when starting or completing a square.[/b] Be sure to call [b]turn_right(90)[/b]enough times in your function to do so.
Vi vill ha en funktion för att rita rutor av valfri storlek. Vi skulle kunna använda dessa rutor som konturer när vi väljer enheter i ett taktiskt spel, som en ram för föremål i en inventering och mer. Skapa en funktion som heter [code]draw_square()[/code] som tar en parameter: [code]length[/code] på kvadratens sidor. Sköldpaddan ska vända sig åt höger när man startar eller slutför en rektangel.
We could use these squares as outlines when selecting units in a tactical game, as a frame for items in an inventory, and more.
Create a function named [code]draw_square()[/code] that takes one parameter: the [code]length[/code] of the square's sides.
[b]The turtle should face towards the right when starting or completing a square.[/b]
Be sure to call [b]turn_right(90)[/b] enough times in your function to do so.
Vi skulle kunna använda dessa rutor som konturer när vi väljer enheter i ett taktiskt spel, som en ram för föremål i en inventering och mer.
Skapa en funktion som heter [code]draw_square()[/code] som tar en parameter: [code]length[/code] på kvadratens sidor.
Sköldpaddan ska vända sig åt höger när man startar eller slutför en rektangel.