That link
http://golf.shinh.org/reveal.rb?combination/I.%2C+S.%28cheat%29_1395414997&ijshas
this code:

   wd"1|.1+I.(](]#~[=+/"1@])2#:@i.@^[)/".1!:1]3

According to a link from the page, input to this code is something like 7 2

Since wd has changed its significance from version-to-version, I'll leave
that out and see what text is being sent to it. That leaves me with the
expression:

   |.1+I.(](]#~[=+/"1@])2#:@i.@^[)/".1!:1]3

Since http://www.jsoftware.com/help/dictionary/dx001.htm documents 1!:1]3
as 'read characters from stdinput', we can replace that part of the
expression with '7 2'

   |.1+I.(](]#~[=+/"1@])2#:@i.@^[)/".'7 2'

Or, more simply

   |.1+I.(](]#~[=+/"1@])2#:@i.@^[)/7 2

Or, perhaps even
   |.1+I.7(](]#~[=+/"1@])2#:@i.@^[)2

which simplifies to
   |.1+I.2([(]#~[=+/"1@])2#:@i.@^])7

(further simplifications are possible)

Anyways, this expression evaluates just fine. But, it does not yield text,
So the wd"1 part seems like a problem. Also, 1!:1]3 is a bit tricky (it
fails on the windows version of J I tried and keeps reading line after line
on my linux version of J which I tried).

So I think that that code might not have been tested very much.

Thanks,

-- 
Raul


On Sun, Apr 6, 2014 at 4:08 PM, Ray Zhao <[email protected]> wrote:

> Thanks for all the tips, prev repliers! ^u^
> I also found this from one of the posted replies
> http://www.jsoftware.com/pipermail/programming/2007-April/006091.html so I
> guess that explains a lot already.
>
> Anyway, I was trying that type of program out because on sites like anarchy
> golf, J programs have to read some sort of input:
>
> http://golf.shinh.org/reveal.rb?combination/I.%2C+S.%28cheat%29_1395414997&ijs
> When I directly copypaste that into jqt 801 and press enter it's a syntax
> error. Also, it uses 1!:1 3 so I guess that's some difference between that
> and 1!:1 1. ._.
>
> So, why does the copypaste make a syntax error? (not quite sure what wd
> means)
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to