Content deleted Content added
No edit summary |
No edit summary |
||
Line 64:
Is the "shuffling cards in four characters" quote true, or is it just a joke? If the former, the four characters should be given in the article; if the latter, maybe a comment to that effect would be nice.
The expression 52 ? 52 will give you a pesudo-random permutaion of the numbers from 1 to 52 (or 0 to 51, depending on the current index origin). This can reasonably be called "shuffling cards" although to display this list of values as symbold for cards would take a little more code. This is 5
To represent dealing 52 cards to 4 players, one might write something like:
D {gets} 4 13 {reshape} 52 ? 52
That is 11 characters, two of which are non standard: {gets} which represents the left-pointing assignment arrow, and {reshape} which represents the shape/reshape primitave function, a version of the greek character rho in a standard AL character set.
Do you think this like of code, perhaps in an image foramt should appear in the article to clarify (and in part debunk) the quote? [[User:DESiegel|DES]] 18:09, 21 Feb 2005 (UTC)
== Sort Example ==
Line 70 ⟶ 81:
--[[User:217.245.7.251|217.245.7.251]] 12:39, 5 Feb 2005 (UTC)
▲The expression 52 ? 52 will give you a pesudo-random permutaion of the numbers from 1 to 52 (or 0 to 51, depending on the current index origin). This can reasonably be called "shuffling cards" although to display this list of values as symbold for cards would take a little more code. This is 5 cahracters, but only 3 symbols, as i would call a sungle number a single symbol, no matter how many digits it needs to represent it. In fact, this function is called "deal" which makes the sufgested use tolerably obvious.
The primiive functions grade up, and grade down ((“) and (”) view with an APL font) -- they are not operators in APL terminology -- sort arrays of numeric values. If the array is multi-dimensional, a multi-way sort will be performed. The result is the set of indicies needed to reshape the array into a sorted form. Sorting of character data is also provided by these functions, but a left arguemt giving the collating sequence to be used must be supplied. A complex sequence (for example, upper and loewr case letters rating as identical unless needed to break ties) can be provided by using a multi-dimensional left argument. [[User:DESiegel|DES]] 17:50, 21 Feb 2005 (UTC)
|