Re: [Jprogramming] Project Euler 1

2016-05-06 Thread Geoff Canyon
On Fri, May 6, 2016 at 4:43 AM, Martin Kreuzer wrote: > At that stage I realized that (/) isn't only "Insert" but also used to > force a "Table": > ​Yep, this was new to me as well, as evidenced by my original awkward |"0 1 construction. --

Re: [Jprogramming] Project Euler 1

2016-05-05 Thread Geoff Canyon
box a command to show how that flow works, but I don't remember it. Or maybe that's not it at all and I'm just confused. thx gc On Wed, May 4, 2016 at 11:35 PM, Raul Miller wrote: > On Wed, May 4, 2016 at 10:35 PM, Geoff Canyon wrote: > > So I tried to write code to s

[Jprogramming] Project Euler 1

2016-05-04 Thread Geoff Canyon
So I tried to write code to solve the general case of Project Euler problem 1. The problem given is to find the sum of all the positive integers less than 1000 that are divisible by 3 or 5. Obviously the specific case is highly optimizable. But I wanted to solve the general, with any number of divi

Re: [Jprogramming] advent 15

2015-12-15 Thread Geoff Canyon
​I'm curious how fast J is to write for someone who knows what they're doing? In AdventOfCode only the first 100 submissions make the leaderboard, so speed is a premium. I dabble in J, but I'm *far* more comfortable in LiveCode, and that's what I use for AdventOfCode, although I sometimes go back

Re: [Jprogramming] adventofcode 11

2015-12-12 Thread Geoff Canyon
On Fri, Dec 11, 2015 at 11:11 PM, Raul Miller wrote: > Is this enough to make clear what was happening there? > Thanks -- in the end I understood it well enough to see that it had a bug, and create a correct alternative, so I'm feeling pretty good about it now.​ -

Re: [Jprogramming] adventofcode 11

2015-12-11 Thread Geoff Canyon
On Fri, Dec 11, 2015 at 6:56 PM, Ryan Eckbo wrote: > inc=: >:&.(26&#.)&.(alpha&i.) > ​I get: inc 'a' b inc 'z' ba inc 'y' z And my grasp of J isn't strong enough to figure out why. I came up with this alternative that seems to work: inc =: ((26&|)@>:)&.(alpha&i.) Perhaps that could

Re: [Jprogramming] 'Tis the Season...

2015-12-02 Thread Geoff Canyon
On Wed, Dec 2, 2015 at 11:39 AM, Joe Bogner wrote: > require 'trace' > ​That's a lot to dig through, thanks!​ -- For information about J forums see http://www.jsoftware.com/forums.htm

Re: [Jprogramming] 'Tis the Season...

2015-12-02 Thread Geoff Canyon
On Wed, Dec 2, 2015 at 10:15 AM, Joe Bogner wrote: > Without it, J sees (+:@+) / > Is that because @ binds more tightly than / or am I thinking in C terms? As an aside, I love how J makes me think *completely* differently about programming. I have developer friends who think they're multi-lin

Re: [Jprogramming] 'Tis the Season...

2015-12-02 Thread Geoff Canyon
On Tue, Dec 1, 2015 at 11:22 PM, Joe Bogner wrote: > Some feedback: > Thanks! I definitely tend to throw parentheses at the problem when a train doesn't work the way I expect. And looking at everyone else's solutions, I realized that the weakness of my understanding of i. was making my solution

Re: [Jprogramming] 'Tis the Season...

2015-12-01 Thread Geoff Canyon
Spoiler (my solution, looking for feedback) . . . . . . . . F =: #-(+:@(+/@('('&i.))) If S is the string from the site, then F S returns the ending floor (the first part of the challenge). Any suggestions on improving the syntax are welcome, I only dabble in J. thx gc --