278 posts
Posted 26 February 2012 - 01:35 AM
I made some AIs yesterday (Some people don't they are) and I was hoping there was a way to make them learn. Is it something to do with tables? I have a short code for my most advanced AI here:
http://pastebin.com/jL5rCCAU Thanks! Also, it took my most advanced AI 3 minutes to get through this maze:
[media]
http://www.youtube.com/watch?v=TS2hu9TSO1M[/media]
8 posts
Posted 26 February 2012 - 02:03 AM
some tips on your code, the first turtle.detect(); is useless it doesnt do anything and could be removed without affecting the behavior, second (if turtle.detect() == true then) is the same than (if turtle.detect() then), turtle.detect() returns a boolean which is already true or false, comparing a true or false against true is just an unnecessary step, also if you want the turtle to look smarter give it small random sleep(n) between the turns so it looks like hes actually thinking and not just following an algorithm, i dont know much in AI but experimenting with trial and error is the programmer best friend
411 posts
Posted 26 February 2012 - 02:10 AM
Yes, if you wanted them to learn you would use tables.
You would then make a map with the tables and store the data about where the path is inside that map
278 posts
Posted 26 February 2012 - 02:25 AM
Yes, if you wanted them to learn you would use tables.
You would then make a map with the tables and store the data about where the path is inside that map
So, I would have it modify the table as it goes, and it can then follow that path?
411 posts
Posted 26 February 2012 - 02:34 AM
Well basically you would make it learn the path that its taking and then you could tell it not to go somewhere that it's already been before. That way it will always atleast find a new place to go :)/>/> Of course if your talking about a maze you would have to allow it to go so far back as to make another turn at an intersection
1688 posts
Location
'MURICA
Posted 26 February 2012 - 06:00 AM
It would go faster if it followed the "keep right" rule instead of randomly choosing a direction with the chance of getting stuck over.