Thanks for pointing that out. I had a hunch there was a way to use some
wizardry to circumvent the rules.
I had read about 128!:2, but it kind of flew over my head when I did.
So, indeed, change of rules:
Scoring (for this particular challenge) is now determined as
the number of characters in the vector which completely
defines the solution to be scored. That is, if V is a character
vector which, when pasted into a fresh J session, defines
a solution to the problem, that solution’s score is #V.
Pro-verbs may be used if they make your solution shorter,
for example if a certain function is used twice.
That means that spaces count, as well as pure data in the function
(i.e. (i:1) instead of _1 0 1).
So Mr. Quintana (is it Jose or Mario, or both?), your function is a valid
solution, but its score is 62, whereas q before application of cheating
has a score of 50 if defined like in the spoiler at bottom.
This way creative solutions are allowed, but don’t necessarily outgun
plain old straightforward ones.
Thanks again for the heads up!
Louis
a. ([ {~ #@[ #.^:_1 ]) 0 ". 0 : 0 -. 10{a. NB. the x is important! Spoiler
alert...
15842145538293623489408236743258168306092594834612485955458720753024030458070155
28963288900863574206690931677952700488043786247627705399387356278021165186153241
43978366600098599211419509052658207919143087713307612560026448880739407007990949
23777481613236111045214769553522153217795291741293234167221487071184896435439170
26173872195333826470874371962866411532693670197561405249755092094980417532754789
29012782448084591400399972108441723665500308610797728891527215731602742633924018
62801799597613653896648631067687952748045980381252704006618939586003795243470147
686968621161285291180541387929601794429126445195295754x
)
q=:;@:(<@(],"1 0 i.@[-.]+(i:1)*/~#\.@])"1)^:[&’'
The line-feed at the end counts!
> On 22 Aug 2016, at 00:54, Jose Mario Quintana <[email protected]>
> wrote:
>
> The reference did not make it last time; here it is,
>
> [0] [Jprogramming] Adverbial Tacit Jym Jose Mario Quintana
> http://www.jsoftware.com/pipermail/programming/2016-August/045622.html
>
>
>
>
> On Sun, Aug 21, 2016 at 6:34 PM, Jose Mario Quintana <
> [email protected]> wrote:
>
>> I am afraid that you must strengthen the rules; the easiest way would be
>> to add "no cheating is allowed." Otherwise, one can cheat easily [0]
>>
>> [0]
>>
>>
>>
>>
>>
>> On Sat, Aug 20, 2016 at 6:49 PM, Louis de Forcrand <[email protected]>
>> wrote:
>>
>>> Alrighty then.
>>>
>>> Let’s start this off with a couple of rules:
>>> - We can either count characters or tokens; I suggest tokens.
>>> Either one should be counted on fixed (f.) functions.
>>> - Programs can be restricted to either tacit or explicit, or not.
>>> In the latter case counting tokens would be ambiguous, so I
>>> don’t think the two should be used together.
>>>
>>> Of course this could change from task to task, and should be clarified
>>> at the beginning of new challenges.
>>> I won’t be coming up with all of the challenges; you should make some
>>> up too.
>>>
>>>
>>> Without further ado, here is a simple first challenge:
>>> Write a verb which takes a scalar N, and returns all solutions to the
>>> N-Queens problem in the form of a rank-2 array of rank-1 permutation
>>> vectors. Given a vector V, the queens’ coordinates are:
>>>
>>> (,.~ i.@#) V
>>>
>>> This can be done because we know that no two queens can be
>>> placed on the same row.
>>>
>>> I suggest counting tokens of tacit solutions using this verb:
>>>
>>> scr=: #@;:@(5!:5) NB. score verb: scr ‘foo’ ; ‘bar’ ; ‘baz’
>>>
>>> If you have a better suggestion for scoring or rules, feel free to chime
>>> in.
>>> In addition, if you feel your version is particularly elegant, or
>>> efficient,
>>> or posses any other attribute you deem worthy, please share it with us,
>>> even if it is does not have an especially low score.
>>>
>>> I will be posting my contender soon.
>>>
>>> Cheers,
>>> Louis
>>>
>>>
>>>> On 20 Aug 2016, at 21:47, Joe Bogner <[email protected]> wrote:
>>>>
>>>> Hi! Welcome. I think this is the right place.
>>>>
>>>> Source: http://www.jsoftware.com/forums.htm
>>>>
>>>> On Aug 20, 2016 3:35 PM, "Louis de Forcrand" <[email protected]> wrote:
>>>>
>>>>> Hi everyone,
>>>>>
>>>>> Would this be the appropriate place for some Jolfing (J code golfing),
>>>>> or is there a better place for this?
>>>>>
>>>>> Thanks,
>>>>> Louis
>>>>>
>>>>> ----------------------------------------------------------------------
>>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>> ----------------------------------------------------------------------
>>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
>>
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm