Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local path="storage/sdcard0/DWorkspace/ACOS ideas/Andy (Dev)/EA testing"
- dofile(path.."/lib/indv.lua")
- world={
- {0,0,0,0,0},
- {0,0,0,0,0},
- {0,0,1,0,0},
- {0,0,0,0,0},
- {0,0,0,0,0},}
- function serialize(table)
- local sresult,k1="{\n",nil
- for k,v in pairs(table) do
- if type(v)=="table" then k1=serialize(v) v1="," else k1=k v1="="..v.."," end
- sresult=sresult.." "..k1..v1.."\n"
- end
- return sresult.."}"
- end
- function refuel(x)
- print"refuel called"
- local newW=x:feed(world)
- if not newW then print("Could not refuel") return false else world=newW end
- print"--Refuel Complete!--"
- print("Current fuel lvl:"..x.fuel)
- end
- local individuals={}
- test=individual:new()
- test:go(world)
- test:turnLeft()
- refuel(test)
- dofile(path.."/AIs/testAI.lua")
- print(test.fuel)
Advertisement
Add Comment
Please, Sign In to add comment