Talk:Box the compass

From Rosetta Code

General

The naming sequence was more complex than I originally thought. I started by coding up a generic quarter of the points but North and South take precedence over East and West in some of the orderings and so I had to 'reflect' a quarter, quarter1 to make quarter2 in the Python solution.

P.S. Couldn't help the Pirate speak :-)

--Paddy3118 21:43, 27 March 2011 (UTC)

I chose to just put in a list of all the packed representations (which are very slightly modified from the official abbreviations to add hyphens). The fact that I don't have to do a lot of quoting of the strings makes this a very attractive option in Tcl. –Donal Fellows 10:10, 28 March 2011 (UTC)
I like the way you've done it. Coding all 32 points is done so compactly and you skip all the logic for choosing quarters. Neat! --Paddy3118 12:53, 28 March 2011 (UTC)
In my VB.net implementation I chose to build the list of points into an array beforehand and keep it separate from the calculation subroutine. It was implemented in a similar way to the Python routine otherwise. Admittedly, it'd probably have been more efficient just to write the list of points straight into the array, but would have been far less interesting that way! --TheMadman 13:31, 28 March 2011 (UTC)