Talk:Langton's ant: Difference between revisions

→‎Chirality?: Correctness is tricky
(→‎Chirality?: many ways to screw this up...)
(→‎Chirality?: Correctness is tricky)
Line 16:
: The task never specifies the initial color of the field. Can one produce a mirror image by swapping the initial color. --[[User:Kernigh|Kernigh]] 01:20, 10 March 2012 (UTC)
:: Er, yes it does: white is specified for the initial ground color in the first sentence. Upon reflection (no pun intended, except maybe retroactively), there are several other ways that the image can come out mirrored. In the case of Ada, we see that the color is tested after inversion rather than before inversion, so the ant turns the wrong way. In other cases, it appears that the x/y coordinates are assumed to be on a standard mathematical graph, but then then one of the axes is flipped upon output by traversing one of the dimensions in the opposite order. (The Perl 6 solution assumes the whole graph is printed on its side, but that's merely a rotation around the origin, not a mirror flip.) It's also possible some of the examples are merely screwing up what is true and false. --[[User:TimToady|TimToady]] 01:34, 10 March 2012 (UTC)
 
::: I'd argue that a rotation is still correct, but that the Ada solution is ''technically'' wrong (because the implementation uses the wrong information to act). Mind you, mere renaming of the variables should not be enough to invalidate a solution, so solutions which are of the wrong handedness because of exchanging x/y are also correct (except for the display code, which is not the focus of the task). –[[User:Dkf|Donal Fellows]] 07:08, 10 March 2012 (UTC)
Anonymous user