[Jprogramming] k programming challenge

Brian Schott schott.brian at gmail.com
Wed Jan 27 14:30:25 UTC 2016


Raul,

I have been trying to understand your verb  word using the following
sentence from your post.

   words'Though of course, it''s possible to format that result
differently.'
+------+--+------+--+-+--------+--+------+----+------+-----------+
|though|of|course|it|s|possible|to|format|that|result|differently|
+------+--+------+--+-+--------+--+------+----+------+-----------+

As you see above, it seems to work, but I cannot understand it. At one
point I thought only ;: and tolower  alone would be enough but even got
 the error  below.

   ;:'Though of course, it''s possible to format that result differently.'
|open quote
|   Though of course, it's possible to format that result differently.
|                       ^
|       ;:'Though of course, it''s possible to format that result
differently.'



On Wed, Jan 27, 2016 at 7:33 AM, Henry Rich <henryhrich at gmail.com> wrote:

> That's clever.
>
> Henry Rich
>
> On 1/27/2016 12:15 AM, Raul Miller wrote:
>
>> I guess I'd be inclined to do it like this:
>>
>> require'web/gethttp'
>> const=: gethttp 'http://usconstitution.net/const.txt'
>> words=: [: ;: ' '"_`(I.@:= toupper)`]}~@tolower
>>
>>     \:~ (<@#/.~,.~.)words const
>> +---+-----+
>> |727|the  |
>> +---+-----+
>> |495|of   |
>> +---+-----+
>> |306|shall|
>> +---+-----+
>> |264|and  |
>> +---+-----+
>> |202|to   |
>> ...
>>
>> Though of course, it's possible to format that result differently.
>>
>> Thanks,
>>
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
(B=)


More information about the Programming mailing list