« first day (2504 days earlier)      last day (91 days later) » 

4:39 AM
Looks like this wrongly includes numbers like
.....
.10.*
.....
 
 
1 hour later…
5:43 AM
Day 4 is easy, even for APL novice
 
 
4 hours later…
Ven
9:19 AM
@rabbitgrowth Ah, thanks
New cursed version, works on my little test, still doesn't quite work on my input:

{⊂(~×/(,⍵(↓⍨⍤1)-3-≢⍕p)∊' .',⎕D)×(~(2 1⌷⍵)∊⎕D)×((2 2⌷⍵)∊⎕D)×p←⍎(v∊⎕D)/v←'0',2↓¯1⌽2⌷⍵}⌺3 5⊢parsed←↑' '(≠⊆⊢)input
 
 
1 hour later…
Ven
10:31 AM
Urgh, I can't figure it out. I calculated 30 lines manually and they match...
 
Ven
10:52 AM
Oh, I return 50 more than I should...
 
Ven
11:33 AM
Oh, my mask accepts 5*5 as 55
Right, because I do (v∊⎕D)/v←, but I really should only take 5 and throw away *5. I need to figure it out...
Is there a way to get "the starting sequence of 1s"? I guess I could partition instead of replicating.
OK, that works!
+/+/{⊂(~×/(,⍵(↓⍨⍤1)-3-≢⍕p)∊' .',⎕D)×(~(2 1⌷⍵)∊⎕D)×((2 2⌷⍵)∊⎕D)×p←⍎⊃(v∊⎕D)⊆v←'0',2↓¯1⌽2⌷⍵}⌺3 5⊢parsed←↑' '(≠⊆⊢)input
I will very, very happily accept suggestions while I take a look at the 2nd part...
@LdBeth It was more annoying than I thought, but it was definitely feasible :-).
 
You're also not including single-digit numbers on the rightmost edge, but those don't appear in my input at least
 
Ven
11:49 AM
Huh, I could've sworn I specifically tried that case.
Thanks for the help, BTW
 
You're welcome! It's fun.
 
How do I get the box around array elements in RIDE? Which setting do I change?
 
12:06 PM
]box on
 
Ven
12:20 PM
Ah, right, rightmost 5 will be ..5 in its cell
There are ways I could fix it, I can't think of any satisfying ones atm though. Maybe rotate if the end is double space...
I'll focus on part2 first
 
12:42 PM
Append a column of dots to the right of the input?
 
Thanks @RikedyP .
 
@Ven ∧\? That way you can get rid of the (2 2⌷⍵)∊⎕D test too.
 
Ven
@rabbitgrowth I considered a scan, but I'm not sure how that'd look like.
 
+/,{(1∊~(⎕D,'. ')∊⍨⍵↑⍤1⍨2+≢n)×(~⎕D∊⍨2 1⌷⍵)×⍎'0',n←{⍵/⍨∧\⍵∊⎕D}2(1+⍳3)⌷⍵}⌺3 5⊢input,'.'
My input is the character matrix, btw. Not sure why you're splitting on spaces - I don't think the input contains any?
 
Ven
12:57 PM
ah, the spaces are the newlines when pasted in tryapl
 
Ah, I see
 
1:12 PM
Cleaned up a bit:
+/,{(~∧/(⍵↑⍤1⍨2+≢n)∊⎕D,'. ')×(~⍵[2;1]∊⎕D)×⍎'0',n←{⍵/⍨∧\⍵∊⎕D}⍵[2;1+⍳3]}⌺3 5⊢input,'.'
I wonder if there's a nicer way to do "format number, but 0 if empty string" than ⍎'0'∘,
 
Ven
Me too.
I like 2(1+⍳3)⌷⍵ :-).
 
¯1↓1↓2⌷⍵ seems nice too.
 
Ven
I hesitated between that and a rotate in the middle, just to throw in a bit of variety.
 
1:33 PM
Not sure why I wrote ⎕D,'. ' instead of ' .',⎕D. ' .',⎕D seems nicer as that's in ASCII/Unicode order :P
 
Ven
Just to throw me off :-).
 
 
2 hours later…
3:36 PM
@rabbitgrowth You mean execute. Btw, that fails on negative numbers. ⊃⊃⌽⎕VFI string is the proper way.
 
Ven
It doesn't need to support negative numbers, thankfully
This was my first real use of stencil, and though I made a mess, I'm still glad I got it to work.
 
3:54 PM
Survey: Please let Dyalog know your thoughts about the Dyalog user meetings — even if you've never attended.
 
Ven
4:22 PM
How many non-professionnal APL developers attend Dyalog user meetings, generally?
 
@Ven Only a couple of hobbyist APLers tend to attend, of which one is the competition winner.
 
 
3 hours later…
Ven
7:15 PM
For part2, I'm considering doing {⊂'*'=2 4⌷⍵}⌺3 7⊢parsed and parsing around
 
 
2 hours later…
Ven
9:41 PM
Mh, maybe I should try ⍸⍵∊⎕D, see which indices are relevant
I'm not sure how to go about this :|
I can't partition, at least I don't think I can. I could try to take the 3x3 elements around the *, see which contain a number, but then I need to figure out where the numbers are and how to parse them
and it could be a single number above it, or one top left and one top right, or...
 
Ven
9:54 PM
Oh, it's only two digits numbers
 
 
1 hour later…
Ven
10:55 PM
I got to this and... it looks like it works.


parsed←↑' '(≠⊆⊢)input
map←(⍴parsed)⍴d×+\2</0,d←(,parsed)∊⎕D
nums←⍎¨(input∊⎕D)⊆input
pos←↑{⊂∪0~⍨,3(↑⍤1)(⍵[2]-2)(↓⍤1)3↑(⍵[1]-2)↓map}¨⍸'*'=parsed
+/{((2=⍴)××/)nums[⍵]}¨pos
For the basic example of course, on my input it gives "That's not the right answer; your answer is too high" and I'm way too tired to debug that now.
 

« first day (2504 days earlier)      last day (91 days later) »