top | item 10039577

(no title)

FooNull | 10 years ago

I didn't beat your score on level 1, but I did create a dynamic solution in javascript. You can view it at http://pastebin.com/wMVyqvz3 (copy and paste the code into honeypot and switch the language setting to js, obviously).

My script builds a map of the level as the robot drives around, using information from the lidar scans with each step. It can then use this map to seek out unknown areas, plan movements, detect enemy movement on all 4 sides, lots of things

The framework is relatively robust. Feel free to erase my `exports.update` function and write your own. As long as you use the custom tank.forward(), tank.shoot(), tank.turn_right() (etc) functions instead of calling their api, it will build a reliable map that you can reference for better decision making.

If you want to see an ASCII version of the robot's internal view of the map, change the `var verbose = false;` to true at the top of the script. But this tends to make my browser lag after the ~60th step. So much output! But it also gives you a step-by-step breakdown of the logic for why it's making each decision. Which is interesting to watch, and useful for debugging.

The whole thing is pretty messy. And I'd like to clean it up, but after 3 days and not getting anything else accomplished in my life (like work) I need stop for a while. It was a fun proof of concept for mapping.

discuss

order

No comments yet.