This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Mendax's profile picture

How Can I Make My Turtle Learn?

Started by Mendax, 26 February 2012 - 12:35 AM
Mendax #1
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]
shif #2
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
Casper7526 #3
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
Mendax #4
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?
Casper7526 #5
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
Kingdaro #6
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.