Re: [Jprogramming] Quora Digits Problem

2017-10-15 Thread Rob Hodgkinson
33 >> >> 111222333111222333111222333 >> >> 123123123123123123123123123 >> >> $A >> >> 3 27 >> >> >> >> Find a way to separate all rows and columns with spaces so you can apply “. >> To turn the characters to a 3

Re: [Jprogramming] Quora Digits Problem

2017-10-15 Thread Raul Miller
way to separate all rows and columns with spaces so you can apply “. > To turn the characters to a 3 27 array of jntegers. > > . > > Linda > > > AOL Mobile Mail > > > -Original Message- > > From: Cliff Reiter > To: programming > Sent: Tue, Oct

Re: [Jprogramming] Quora Digits Problem

2017-10-15 Thread Erling Hellenäs
liff Reiter To: programming Sent: Tue, Oct 3, 2017 11:21 PM Subject: Re: [Jprogramming] Quora Digits Problem A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114 1115 1116 1121 1122 1123 1124 On 10/3/2017 4:16 PM, Skip

Re: [Jprogramming] Quora Digits Problem

2017-10-15 Thread 'Mike Day' via Programming
ile Mail -Original Message- From: Cliff Reiter To: programming Sent: Tue, Oct 3, 2017 11:21 PM Subject: Re: [Jprogramming] Quora Digits Problem A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114 1115 1116 11

Re: [Jprogramming] Quora Digits Problem

2017-10-15 Thread Erling Hellenäs
11:21 PM Subject: Re: [Jprogramming] Quora Digits Problem A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114 1115 1116 1121 1122 1123 1124 On 10/3/2017 4:16 PM, Skip Cave wrote: > Another interesting Quora proble

Re: [Jprogramming] Quora Digits Problem

2017-10-15 Thread Linda Alvord
s with spaces so you can apply “. To turn the characters to a 3 27 array of jntegers. . Linda   AOL Mobile Mail -Original Message- From: Cliff Reiter To: programming Sent: Tue, Oct 3, 2017 11:21 PM Subject: Re: [Jprogramming] Quora Digits Problem A cheat (?) that builds instead of &q

Re: [Jprogramming] Quora Digits Problem

2017-10-05 Thread Erling Hellenäs
Hi all! 3!:0 ,+// (|.10^i.4)*/>:i.6 8 The floor operation was not redundant. Marshalls ,+// (10<.@^i._4)*/>:i.6 can be written ,+// (<.10^i._4)*/>:i.6 ,but the floor operation is needed to produce integers. 20 {. ,+// (<.10^i._4)*/>:i.6 1112 1113 1114 1115 1116 1121 1122 1

Re: [Jprogramming] Quora Digits Problem

2017-10-05 Thread Linda Alvord
Not ugly! $,+// (|.10^i.4)*/>:i.6 1296 Linda Sent from AOL Mobile Mail On Wednesday, October 4, 2017 Cliff Reiter wrote: I was stunned to see how fast, and on pausing, how beautiful Marshall's were. Very unusual and powerful uses of insert. > I doubt you'll find a much faster J solution th

Re: [Jprogramming] Quora Digits Problem

2017-10-04 Thread Cliff Reiter
I was stunned to see how fast, and on pausing, how beautiful Marshall's were. Very unusual and powerful uses of insert. I doubt you'll find a much faster J solution than: ,(+/~10&*)/ 4#,:>:i.6 or the uglier but slightly quicker ,+// (10<.@^i._4)*/>:i.6 But the problem is structural, not numer

Re: [Jprogramming] Quora Digits Problem

2017-10-04 Thread 'Skip Cave' via Programming
I was stunned by Cliff's cool use of catalog (catalogue?) I had not really grasped the capabilities of the monadic use of '{' on boxed arguments. I had always used { dyadically as 'from' 2 { 1 2 3 3 This was a revelation: {2#<'123' ┌──┬──┬──┐ │11│12│13│ ├──┼──┼──┤ │21│22│23│ ├──┼

Re: [Jprogramming] Quora Digits Problem

2017-10-04 Thread Raul Miller
Yes... I was going to post another version (rather like Don Quinn's: 10#.1+6#.inv i.6^4), but it couldn't approach Marshall's implementations in terms of efficiency, so did not seem worth posting. And then Don posted his. Generally speaking Marshall's approach (which keeps results small until the

Re: [Jprogramming] Quora Digits Problem

2017-10-04 Thread Linda Alvord
Nice! No need to invent a number. Linda Sent from AOL Mobile Mail On Tuesday, October 3, 2017 Cliff Reiter wrote: A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114 1115 1116 1121 1122 1123 1124 On 10/3/2017 4:16 PM, Skip Cave wrote: > Anoth

Re: [Jprogramming] Quora Digits Problem

2017-10-04 Thread Erling Hellenäs
Hi all ! I think Marshalls second method was dead cool. This is the Mike Day problem solved with that method.    ,}.+//(10<.@^i._2)*/(i.10)-.2 4 5 9 10 11 13 16 17 18 30 31 33 36 37 38 60 61 63 66 67 68 70 71 73 76 77 78 80 81 83 86 87 88 Cheers, Erling Den 2017-10-04 kl. 12:20, skrev 'M

Re: [Jprogramming] Quora Digits Problem

2017-10-04 Thread 'Mike Day' via Programming
I've only just seen this thread,  so little to offer,  except to point out that the same approach may be used for this modified problem, which is how I misread it to start with: "... remove all integers that contain certain digits, eg 2 4 5 9" Then Marshall's method may be adapted fairl

Re: [Jprogramming] Quora Digits Problem

2017-10-04 Thread Erling Hellenäs
Hi all! I was a bit curious, so I ran some tests.    ts=: 6!:2 , 7!:2@]    NB. Raul    RaulResult=. (#~ 1- +./@e.&'7890'@":"0) 1000+i.8999    NB. Jimmy    JimmyResult=.(3 : '(0=+/"(1)7 8 9 0 e.~10 10 10 10 #: y)#y') 1000+i.8999    NB. Marshall1    Marshall1Result =. ,(+/~10&*)/ 4#,:>:i.6    NB.

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread 'Skip Cave' via Programming
Wow! brilliant solutions! It will take me a couple of days to parse through these diverse approaches to solving the Digits problem. One of the aspects of J that I appreciate the most is the wide range of creative approaches that seem to materialize when multiple people use J to solve the same probl

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Jimmy Gauvin
Variant on the cheat: zz=.,10#.>{4#<>:i.6 4{.zz 1112 1113 1114 On Tue, Oct 3, 2017 at 11:24 PM, Roger Hui wrote: > V. nice. > > As they say, if you're not cheating you are not trying hard enough. :-) > > > On Tue, Oct 3, 2017 at 8:21 PM, Cliff Reiter > wrote: > > > A cheat (?) that

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Roger Hui
V. nice. As they say, if you're not cheating you are not trying hard enough. :-) On Tue, Oct 3, 2017 at 8:21 PM, Cliff Reiter wrote: > A cheat (?) that builds instead of "removing" > >z=.,".>{4#<'123456' >$z > 1296 >10{.z > 1112 1113 1114 1115 1116 1121 1122 1123 1124 > > > On

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Cliff Reiter
A cheat (?) that builds instead of "removing" z=.,".>{4#<'123456' $z 1296 10{.z 1112 1113 1114 1115 1116 1121 1122 1123 1124 On 10/3/2017 4:16 PM, Skip Cave wrote: Another interesting Quora problem: Given the integers from 1000 to , remove all integers that contain a 7, 8, 9

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Raul Miller
Carelessness on my part. Thanks, -- Raul On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui wrote: > Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense. > > > On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote: > >> Something like this? >> >>(#~ 1- +./@e.&'7890'@":"0) 1000+i.8999 >

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Don Guinn
10#.>:6 6 6 6#:i.6^4 On Tue, Oct 3, 2017 at 3:00 PM, Jimmy Gauvin wrote: >ff=: 3 : '(0=+/"(1)7 8 9 0 e.~10 10 10 10 #: y)#y' > >$ff 1000+i.9000 > > 1296 > >$ff 1000+i.5667 > > 1296 > > On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui > wrote: > > > Why 1000+i.8999? 1000+i.6000 or 1000+

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Marshall Lochbaum
I doubt you'll find a much faster J solution than: ,(+/~10&*)/ 4#,:>:i.6 or the uglier but slightly quicker ,+// (10<.@^i._4)*/>:i.6 Marshall On Tue, Oct 03, 2017 at 03:16:41PM -0500, Skip Cave wrote: > Another interesting Quora problem: > > Given the integers from 1000 to , remove all in

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Jimmy Gauvin
ff=: 3 : '(0=+/"(1)7 8 9 0 e.~10 10 10 10 #: y)#y' $ff 1000+i.9000 1296 $ff 1000+i.5667 1296 On Tue, Oct 3, 2017 at 4:54 PM, Roger Hui wrote: > Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense. > > > On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote: > > > Somethi

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Roger Hui
Why 1000+i.8999? 1000+i.6000 or 1000+i.9000 would make more sense. On Tue, Oct 3, 2017 at 1:48 PM, Raul Miller wrote: > Something like this? > >(#~ 1- +./@e.&'7890'@":"0) 1000+i.8999 > > Thanks, > > -- > Raul > > > On Tue, Oct 3, 2017 at 4:16 PM, Skip Cave wrote: > > Another interesting Q

Re: [Jprogramming] Quora Digits Problem

2017-10-03 Thread Raul Miller
Something like this? (#~ 1- +./@e.&'7890'@":"0) 1000+i.8999 Thanks, -- Raul On Tue, Oct 3, 2017 at 4:16 PM, Skip Cave wrote: > Another interesting Quora problem: > > Given the integers from 1000 to , remove all integers that contain a 7, > 8, 9, or zero, and list the remaining integer

[Jprogramming] Quora Digits Problem

2017-10-03 Thread Skip Cave
Another interesting Quora problem: Given the integers from 1000 to , remove all integers that contain a 7, 8, 9, or zero, and list the remaining integers. Skip -- For information about J forums see http://www.jsoftware.com/fo