Tape tracking NXT Lego Mindstorms Robot
The code is in NXC and I used the NXT Camera. To follow the line, the robot uses a simple PID. The robot uses the sonar to find objects by the road. It uses the light sensor to detect whether it found the right object.
Listing combinations by making transpositions
Suppose you have an apple, an orange, a banana, a pineapple a grape and a screwdriver and you choose to take exactly 3 of these things. This is called a 3-combination of a 6-set, because you chose 3 of the 6 things. Now suppose you want a different set of 3 things by putting one thing back and taking another. Easy, right?
For some inexplicable reason, however, you want to hold every set of three things exactly once and each time you change, you want to swap one item in your hand for one on the table. Is this even possible?!?
The short answer is yes. And I’ve animated it for you! Look at it like this: The colour of the balls in the animation indicates whether the thing in that position has been chosen. Swapping a red ball in position 2 and a blue ball in position 6 simply indicates that the second item was swapped with the fifth item.
Without further ado, enjoy my first ever flash animation.