Talk:Find the missing permutation: Difference between revisions

(→‎prototype J soln: intent and generic nature.)
Line 76:
== J ==
=== prototype J soln ===
The J solution, <code>(] A.~ A.@i.~ -.~ i.@!@#@]) /:~@:{.</code>, could be simplified (rather, made more elegant with e.g. <code>&.</code>) if we don't have to generalize to other permutation orders (i.e. we it explicitly stated we could depend on the universe of symbols being 'ABCD', or the task specified the universe-of-symbols being an input). Right now the solution must determine the universe-of-symbols from the first permutation.
: I would prefer the universe of symbols to be undefined, and for the code to be generic. You might as well think of the data being 0x41, 0x42, 0x43 and 0x44 integer values, 65.0f, 66.0f, 67.0f, 68.0f, or even Rosemary, Paprika, Sage, Thyme; My intent was to consider and compare the permutations of symbols, not <em>necessarily</em> the exact symbols used. It would probably be best to avoid hardcoded assumptions about the universe of symbols --[[User:Short Circuit|Michael Mol]] 05:14, 28 December 2009 (UTC)
: You could also exhibit both solutions, stating in the adjoining text that one is more general than the other. Like that you'd illustrate a point about the J language as well as providing the solution in various levels of elegance. –[[User:Dkf|Donal Fellows]] 13:46, 28 December 2009 (UTC)
Anonymous user