https://adventofcode.com/2021/day/11
The story for the day 11 puzzle is that we have 100 octopuses (10
rows, 10 columns) which are flashing, each with an intensity level
which is a single digit number:
sample=:".@>;._2{{)n
5483143223
2745854711
5264556173
6141336146
6357385478
4167524645
21768417
Hi, my take on day 10 followed the same idea as Mike, removing all paired
brackets (for brevity, I use the term bracket for any of (){}[]<>), noting
that corrupt lines have remaining closing brackets, while incomplete lines
have only remaining opening brackets. I managed to make this one tacit
agai
Neater!
Cheers,
Mike
On 31/12/2021 19:19, Raul Miller wrote:
That is a different approach.
I had avoided even thinking about that approach, because of speed
concerns. But, testing a simple implementation on the large aoc
"puzzle input", I see that this approach completes in less than 17
milli
That is a different approach.
I had avoided even thinking about that approach, because of speed
concerns. But, testing a simple implementation on the large aoc
"puzzle input", I see that this approach completes in less than 17
milliseconds, Plus it makes reasoning about the problem really simple.
Thanks.
I should have looked it up before complaining.
R.E. Boss
-Original Message-
From: Programming On Behalf Of Henry
Rich
Sent: vrijdag 31 december 2021 16:47
To: programm...@jsoftware.com
Subject: Re: [Jprogramming] domain error, known?
;:'x{{{someverb}}'
+-+--+-++--
Sorry - always forget something - bkts ???
bkts =: 4 2 $'()[]{}<>'
I hope the rest is self-contained, but apologies for the ungraceful
character non-alignment. I'd avoided graphic boxing characters and
had sent in fixed-width font where it mattered!
Mike
On 31/12/2021 15:58, 'Michael D
I _think_ I used a somewhat different approach. I'll only deal with
part 1 as
part 2 doesn't add much complexity.
This approach is simple - remove adjacent pairs of opening and closing
brackets of the same kind until there are none. The function is called
reduce:
I've added echo lines only f
;:'x{{{someverb}}'
+-+--+-++--+
|x|{{|{|someverb|}}|
+-+--+-++--+
;:'x{ {{someverb}}'
+-+-+--++--+
|x|{|{{|someverb|}}|
+-+-+--++--+
https://code.jsoftware.com/wiki/Vocabulary/DirectDefinition#Notes_on_.7B.7B_and_.7D.7D
Henry Rich
On 12/31/2021 10:17 AM, R.
the combination x{{{someverb}} gives a domain error, whereas x{ {{someverb}}
works fine.
cannot remember I've seen this mentioned.
R.E.Boss
--
For information about J forums see http://www.jsoftware.com/forums.htm
Many thanks, that helped a lot.
Stefan.
On Fri, Dec 24, 2021 at 1:31 PM Elijah Stone wrote:
> Not having looked at the problem very closely, I notice the adverb is only
> ever passed <: and >. So, I think a potential simplification could come
> by instead conditionally negating the result of th
10 matches
Mail list logo