As I’ve mentioned in a previous post, I had been partitcipating in the WRO 2016 competition. Unfortunately, our team lost the national game in September due to a flaw in the part of the program regarding the surprise rule. In fact, we were the only team that got >= 300 points in both runs. (By the way, we were also the fastest, finishing at 70 seconds if the special rule isn’t counted.) However, since the ranking prioritizes the best score, we ended up in 7th place.
Anyway, while we were working on the program, we ran into a decision: at the hexagon part, should we always go clockwise, or should we change the direction if there isn’t a tank on the first position? (See the rules for more information.)
Thus, I wrote a simple Scala script to brute force all the combinations of the tanks to see how much time we would save if we used the latter:
One-way: (5.605555555555555,List(0, 0, 0, 55, 245, 600)) Two-way: (5.482222222222222,List(0, 0, 0, 76, 314, 510))
The second strategy saves about the time of 0.12 corners. However, detecting whether there is a tank and turning in reverse if not definitely takes more time than that. Thus we stuck to the first strategy, which was also easier to implement.