quot;0 d) *&.>t NB. put each track in the right direction
>>>> ll =: > ([ ,{:@[ + ])&.>/ dl NB. sum from previous end point, and
>>>> concatenate.
>>>> NB. find the distance to the first place encountered more than once.
>>>> ]rr =: +/|+. {.
amp;.>/ dl NB. sum from previous end point, and
>>> concatenate.
>>> NB. find the distance to the first place encountered more than once.
>>> ]rr =: +/|+. {. (~. #~ (1<#)/.~) ll
>>>
>>> Cheers,
>>>
>>> Jan-Pieter
>>>
>&
gt;
>> Jan-Pieter
>>
>> 2016-12-01 21:23 GMT+01:00 'Pascal Jasmin' via Programming <
>> programm...@jsoftware.com>:
>>
>>> looks like I double pasted? all one line.
>>>
>>>
>>> +&| /}. {: > f each/ (,: 0 0 0) (,
<
> programm...@jsoftware.com>:
>
>> looks like I double pasted? all one line.
>>
>>
>> +&| /}. {: > f each/ (,: 0 0 0) (, <)~ |. dltb each ',' cut 'R2, R2, R2'
>>
>> or
>>
>> +&| /}. {: > f each/ (,: 0 0 0) (,
line.
>
>
> +&| /}. {: > f each/ (,: 0 0 0) (, <)~ |. dltb each ',' cut 'R2, R2, R2'
>
> or
>
> +&| /}. {: > f each/ (,: 0 0 0) (, <)~ |. dltb each ',' cut a
>
>
>
> - Original Message -
> From: Joe Bogner
...@jsoftware.com
Sent: Thursday, December 1, 2016 2:39 PM
Subject: Re: [Jprogramming] advent of code 2016
Nice, that sounds like what i had in mind. I get a domain error though:
a =. 'R2, R2, R2'
O =: 4 2 $ _1 0 0 1 1 0 0 _1
f =: 4 : 0
a =. 4 | x ({.@] + _1 1 {~ 'R' = {.@[
27;,' cut a NB. part 1
>
>
> plot <"1 |: }."1 > f each/ (,: 0 0 0) (, <)~ |. dltb each ',' cut a NB. part
> 2, find intersection in plot
>
> general description,
>
> O holds direction vectors,
> 0 0 0 is appended to reversed list of
ppended to reversed list of commands, where position 0 is the
orientation index into 0, and other 2 are x y positions of taxi.
f/ updates orientation and x y on each iteration, where intermediate value a is
new orientation.
- Original Message -
From: Joe Bogner
To: programm...@jsoftware.
I added an alternate solution to problem 1, part 1 -
http://code.jsoftware.com/wiki/Essays/Advent_Of_Code_2016#Imperative_Style_.28cleanup.29
If I had the time, I would think about how to reformulate it so I
could use / to reduce the input to a single solution. I recall using
that pattern last yea
I've started a wiki page for it so we don't have to go back and add
them later. Feel free to edit/add
http://code.jsoftware.com/wiki/Essays/Advent_Of_Code_2016
My solution to the first problem is pretty bad (works though). I
intend to add another solution that's in a more functional style
On Thu
10 matches
Mail list logo