Given this code:
function setup() print("Braitenberg Vehicle Experiment") objects = {} b1 = {} table.insert(b1, BVehicle1:partial(BVehicle1.behaveDefaultMotion, 1, 1)) table.insert(b1, BVehicle1.behaveJitter) table.insert(b1, BVehicle1.behaveAvoidWall) table.insert(objects, BVehicle1(b1, 600,400,0)) table.insert(objects, BVehicle1(b1, 400,600,0)) table.insert(objects, BVehicle1(b1, 800,400,0)) table.insert(objects, BVehicle1(b1, 400,800,0)) table.insert(objects, BVehicle1(b1, 100,500,0)) table.insert(objects, BVehicle1(b1, 200,700,0)) table.insert(objects, BVehicle1(b1, 300,300,0)) table.insert(objects, BVehicle1(b1, 400,200,0)) b2 = {} table.insert(b2, BVehicle1:partial(BVehicle1.behaveDefaultMotion, 1, 1.1)) table.insert(b2, BVehicle1.behaveJitter) table.insert(b2, BVehicle1.behaveSeekFood) table.insert(objects, BVehicle1(b2, 400,400, 0)) food = Food(300,900) end
Using the search thing, putting b1 in find and bAvoidWall in replace and selecting Replace All, it says it’s going to replace 12, replaces 4 times, and you get this:
`
function setup()
print(“Braitenberg Vehicle Experiment”)
objects = {}
bAvoidWalls = {}
table.insert(bAvoidWalls, BVehicle1:partial(BVehicle1.behaveDefaultMotion, 1, 1))
table.insert(b1, BVehicle1.behavbAvoidWallsitter)
table.insert(b1, BVehicle1.behavbAvoidWallsvoidWall)
table.insert(objects, BVehicle1(bAvoidWalls, 600,400,0))
table.insert(objects, BVehicle1(bAvoidWalls, 400,600,0))
table.insert(objects, BVehicle1(b1, 800,400,0))
table.insert(objects, BVehicle1(b1, 400,800,0))
table.insert(objects, BVehicle1(b1, 100,500,0))
table.insert(objects, BVehicle1(b1, 200,700,0))
table.insert(objects, BVehicle1(b1, 300,300,0))
table.insert(objects, BVehicle1(b1, 400,200,0))
b2 = {}
table.insert(b2, BVehicle1:partial(BVehicle1.behaveDefaultMotion, 1, 1.1))
table.insert(b2, BVehicle1.behaveJitter)
table.insert(b2, BVehicle1.behaveSeekFood)
table.insert(objects, BVehicle1(b2, 400,400, 0))
food = Food(300,900)
end
`
Note the double spacing, and the odd creation of behavbAvoidWallsvoidWall and similar oddities.
At a guess, it’s not re-finding the change locations after substituting, or something like that. Anyway, very broken.
Thanks,
R
P.S. the code tick marks don’t seem to work right here, either.