Talk:Box the compass: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎J and task specifics: ALGOL's Traditional wind points)
(Task clarification needed)
Line 45: Line 45:
==ALGOL's Traditional wind points==
==ALGOL's Traditional wind points==
I tracked them down to being the names of Mediterannean winds. Nice to know. ([http://www.mediterranean-yachting.com/winds.htm here] is one of many references or track each name in wikipedia individually). --[[User:Paddy3118|Paddy3118]] 06:11, 16 June 2011 (UTC)
I tracked them down to being the names of Mediterannean winds. Nice to know. ([http://www.mediterranean-yachting.com/winds.htm here] is one of many references or track each name in wikipedia individually). --[[User:Paddy3118|Paddy3118]] 06:11, 16 June 2011 (UTC)

==Task clarification needed==
I think the interval between two neighboring directions is exactly 360/32=11.25 degrees. It is conforming to the '''Middle''' column of the table in the [[wp:Boxing the compass|wikipedia article]]. So I do not understand the meaning of the given sequence of numbers: <code>[0.0, 16.87, 16.88, 33.75, 50.62, 50.63, 67.5, 84.37, 84.38, 101.25, 118.12, 118.13, 135.0, 151.87, 151.88, 168.75, 185.62, 185.63, 202.5, 219.37, 219.38, 236.25, 253.12, 253.13, 270.0, 286.87, 286.88, 303.75, 320.62, 320.63, 337.5, 354.37, 354.38]</code>.
Sorry for my english:)
[[User:Insolor|Insolor]] 12:09, 24 June 2011 (UTC)

Revision as of 12:09, 24 June 2011

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)
For J, I decided to do the simple thing, and then I fix the result by preventing the text of the first word from appearing multiple times in multi-word names. --Rdm 15:35, 28 March 2011 (UTC)
The walk through the table (the actual degrees used) struck me as odd. Basically a sawtooth walk going from lowest to middle to highest as each row is advanced. When I saw the task I expected to see the midpoints as the most obvious. Not sure what the reason was and it's not really important if your function translates an angle to a compass point. I suppose it test finding the edges. Was there a specific reason for that pattern of angles? --Dgamey 15:39, 23 April 2011 (UTC)
Hi Dgamey, yes it was to test the ranges corresponding to a particular point of the compass but still be easy enough to check. --Paddy3118 18:51, 23 April 2011 (UTC)

Capitalization?

The Wikipedia article capitalizes, for example, "Southwest by south". However, a google search shows that as a general rule the capitalization will be either "southwest by south" or "Southwest by South". The Wikipedia capitalization could be rationalized as the lower case variation as it would appear at the beginning of a sentence... Anyways, perhaps the task description should either explicitly require one form of capitalization (and I do not much care which, though the Wikipedia form seems awkward) or should explicitly state that capitalization is a non-issue? --Rdm 14:50, 28 March 2011 (UTC)

The current J implementation abuses the information contained in the wikipedia capitalization to deal with one of the wording quirks. (I would prefer to get rid of that abuse but do not want to code so generally that I am explicitly parameterizing and supporting all three forms of capitalization -- at least not if the task does not require it.) --Rdm 15:10, 28 March 2011 (UTC)
Hi Rdm, What is important is matching the capitalisation of the wp table. But I just looked at the capitalization from the OED, which seems to point to south being lower cased for cardinal points, (except when starting a sentence of course). --Paddy3118 15:39, 28 March 2011 (UTC)


I would argue that the capitalisation is a bit of a non-issue. Strictly speaking, the cardinal directions are not proper nouns therefore shouldn't really be capitalised. I did capitalise mine in the same way as the Wikipedia entry simply because it just wouldn't have looked right otherwise, but I did make sure that the capitalisation subroutine acted on the direction names at display time, not on insertion into the array. --TheMadman 15:32, 28 March 2011 (UTC)
It should appear as in the wp table. Other capitalisations wouldn't be following the task description. --Paddy3118 15:39, 28 March 2011 (UTC)
Absolutely, although if you look at the example at the bottom of the page, the Wikipedia entry does put "east by north" in lower case, suggesting that it's done in the table purely for aesthetics (which, in those circumstances, is probably the correct way to write it), hence my argument of non-issue. --TheMadman 15:50, 28 March 2011 (UTC)
I would also argue that capitalization should not be an issue. If you get concerned about something like that, you're starting to worry about the brand of mustard on the hamburger instead of the actual meat. --Mwn3d 16:11, 28 March 2011 (UTC)

J and task specifics

What should I do about the J solution. No doubt, as the comment seems to suggest, J makes sure that the compass point for all three angles in its fuller row of three headings are all the same, but I am concerned that:

  1. Others will just look at J's solution and not check.
  2. It is not strictly comparable to other entries.
  3. The full wp table misses out -5.62 and 365.62

For these reasons, I am inclined to stick an incomplete tag on the J example and require it to produce what was asked for; or add to their current entry another version that does strictly what was asked for. Would this be OK Rdm? --Paddy3118 15:54, 28 March 2011 (UTC)

I think I understand your concerns, ... (Editted: and the task description now matches them). --Rdm
Hi Rdm, the task has the note on computing the index and headings to convert that isn't in your current example but is in others. --Paddy3118 19:48, 28 March 2011 (UTC)
I believe I have the compass index in the J implementation. I believe I have included all the headings asked for in the task description. I believe the headings I use are in the same order that they are specified in the task description. So I am not sure what you meant here. Is it possible you were looking at a cached version of the page when you wrote this? --Rdm 20:26, 28 March 2011 (UTC)
Hi Rdm, points at index 7,15,23,31 are off slightly. (The wording of the point). --Paddy3118 20:01, 28 March 2011 (UTC)
Thank you, fixed. (I now sort the hyphenated words so that the shortest name in the pair comes first.) --Rdm 20:19, 28 March 2011 (UTC)

ALGOL's Traditional wind points

I tracked them down to being the names of Mediterannean winds. Nice to know. (here is one of many references or track each name in wikipedia individually). --Paddy3118 06:11, 16 June 2011 (UTC)

Task clarification needed

I think the interval between two neighboring directions is exactly 360/32=11.25 degrees. It is conforming to the Middle column of the table in the wikipedia article. So I do not understand the meaning of the given sequence of numbers: [0.0, 16.87, 16.88, 33.75, 50.62, 50.63, 67.5, 84.37, 84.38, 101.25, 118.12, 118.13, 135.0, 151.87, 151.88, 168.75, 185.62, 185.63, 202.5, 219.37, 219.38, 236.25, 253.12, 253.13, 270.0, 286.87, 286.88, 303.75, 320.62, 320.63, 337.5, 354.37, 354.38]. Sorry for my english:) Insolor 12:09, 24 June 2011 (UTC)