Closed bennlich closed 2 years ago
CircleCI reports a failure, in testing. May not be a big deal.
I don't know if it would be useful, but how about a new method or flag: patchAhead(x, y, wrap=false)
Existing code would not be affected and you can try to see if it gives you enough wrap support.
What about a new world or patches property that defines whether or not the world wraps?
Turtles have an off-world property/function that includes wrapping. It also has clamping, bounce and any function you hand to it.
It might be confusing to have the World have something similar but not the same?
But more important, does simply changing the one method solve your problem? Or do you need more than that?
It would be great to find a sweet spot!
On testing: we have two sets of tests (puppeteer & unit testing of Turtle3D). These are the npm "test".
But also a test that run all the one pagers in separate browser tabs. We do this for views2, views3, views3d. It's great because it lets you run everything and look for dead tabs!
It catches LOTS of bugs.
I think I lost a response, basically have a flag for patchAhead(x,y,wrap=false) so existing models/usage is the same but wrap is availalable.
Just to be clear, the nifty running the models in the browser as separate tabs is not in the npm test feature, it doesn't have a "fail" that could be caught. Instead I run it by hand.
npm run2c, run3c, run3dc
Just to be clear: turtles resolve this by using the this.atEdge = 'wrap' default. At edge for turtles has several possibilities. From docs:
Also, each breed can have different behavior.
patches.patch(x,y) does call model.world.isOnWorld(x, y) and if off world, returns "undefined".
To resolve this would be puzzling for the programmer I think. I.e. if patches "wrapped" and turtles "bounced".
I believe the this.atEdge = 'wrap' default above resolves this.
An experiment in torus topology! With this change,
patchAhead
never returnsundefined
, which is cool. But does this break anything? How do we test, @backspaces ?