Team Neville

"You show spirit and bravery, and you come of noble stock. You will make a very valuable Death Eater. We need your kind, Neville Longbottom."

"I’ll join you when hell freezes over," said Neville. "Dumbledore’s Army!" he shouted, and there was an answering cheer from the crowd, whom Voldemort’s Silencing Charms seemed unable to hold.

- Harry Potter and the Deathly Hallows

Our Strategy

Our first thought for our strategy was to WIN! But clearly, there needs to be more to this strategy to accomplish this goal.

Given that the first 10 seconds were for exploration only, we included a beginning loop so that Neville went round the entire board in the beginning giving us extra points.

We chose to go clockwise around the board because this would stop us doubling back on ourselves and wasting time. Especially because Neville moved slowly, every second counted and we wanted to use them all to collect points.

Sometimes Neville did not line himself up perfectly to spin the gearbox or pull the lever. We included some code to make him back away and realign himself. We did not want him to keep trying for the entire match because this would waste precious time. To prevent this, we had him give up after a certain number of tries and move onto the next territory.

To avoid collisions with other robots, we added code to monitor the other robot’s position. If the other robot was in the territory that Neville intended to mine, he would move on to the next territory instead.

We wanted to collect lots of balls and then dump them with only 10-20 seconds left. However, there were two limiting factors: our tray size and malfunctioning timeouts. Our final code had Neville dump the balls after he had mined two territories.