https://4tronix.co.uk/
Now we can generalise by creating a function that takes two values: number of sides and length of each side. This example draws an octagon by specifying 8 sides to the function:
Now we can generalise by creating a function that takes two values: number of sides and length of each side. This example draws an octagon by specifying 8 sides to the function:
we can then generalise the square to any number of sides by changing the number of repeats to the number of sides required, and the angle to turn to be 360 divided by the number of sides. This is valid for all numbers greater than 2. A hexagon has 6 sides:
we can then generalise the square to any number of sides by changing the number of repeats to the number of sides required, and the angle to turn to be 360 divided by the number of sides. This is valid for all numbers greater than 2. A hexagon has 6 sides:
To complete the square we need to repeat this operation 4 times, once for each side (or once for each corner).
So let's use the Repeat loop built in to Makecode. This code will draw the full square and leave the BitBot PRO where it started:
To complete the square we need to repeat this operation 4 times, once for each side (or once for each corner).
So let's use the Repeat loop built in to Makecode. This code will draw the full square and leave the BitBot PRO where it started:
Because BitBot PRO can move and turn accurately, we can use it to draw geometric figures. Let's start with drawing a square. We first have to draw one side, then turn 90 degrees. Like this
Because BitBot PRO can move and turn accurately, we can use it to draw geometric figures. Let's start with drawing a square. We first have to draw one side, then turn 90 degrees. Like this