#apljk — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #apljk, aggregated by home.social.
-
CW: Advent of Code 2025, day 8 in K
init:1+!n:#:d:`I$","\'0:"08.in"
ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
steps:1000#
:one:*/t 3#>t:.#'=init conn/steps ds
:two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.
-
CW: Advent of Code 2025, day 8 in K
init:1+!n:#:d:`I$","\'0:"08.in"
ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
steps:1000#
:one:*/t 3#>t:.#'=init conn/steps ds
:two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.
-
CW: Advent of Code 2025, day 8 in K
init:1+!n:#:d:`I$","\'0:"08.in"
ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
steps:1000#
:one:*/t 3#>t:.#'=init conn/steps ds
:two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.
-
CW: Advent of Code 2025, day 8 in K
init:1+!n:#:d:`I$","\'0:"08.in"
ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
steps:1000#
:one:*/t 3#>t:.#'=init conn/steps ds
:two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.
-
CW: Advent of Code 2025, day 8 in K
init:1+!n:#:d:`I$","\'0:"08.in"
ds:1_'ds@<ds:{(+/t*t:d[x]-d[y]),x,y}.'p@&</'p:+!n,n
conn:{(x*~f)+x[y[0]]*f:x=x[y[1]]}
steps:1000#
:one:*/t 3#>t:.#'=init conn/steps ds
:two:*/*+d {:[&/g=*g:conn[x;*y];*y;o[g;1_y]]}[init;ds]Part 2 takes a metric eternity to converge. There must be a better solution, but this will have to do for now.
-
CW: Advent of Code 2025, day 7 in K
rng:!#*data:0:"07.in"
spls:l@&0<#'l:&'"^"=1_data
msks:(+/rng=/:(-1;1)+)@/:/:spls
f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
str:(1_x)*~|/t
((+/0<n)+*x),str+spl}
:(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# splsIt was a pleasant surprise that a single fold could solve both parts.
-
CW: Advent of Code 2025, day 7 in K
rng:!#*data:0:"07.in"
spls:l@&0<#'l:&'"^"=1_data
msks:(+/rng=/:(-1;1)+)@/:/:spls
f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
str:(1_x)*~|/t
((+/0<n)+*x),str+spl}
:(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# splsIt was a pleasant surprise that a single fold could solve both parts.
-
CW: Advent of Code 2025, day 7 in K
rng:!#*data:0:"07.in"
spls:l@&0<#'l:&'"^"=1_data
msks:(+/rng=/:(-1;1)+)@/:/:spls
f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
str:(1_x)*~|/t
((+/0<n)+*x),str+spl}
:(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# splsIt was a pleasant surprise that a single fold could solve both parts.
-
CW: Advent of Code 2025, day 7 in K
rng:!#*data:0:"07.in"
spls:l@&0<#'l:&'"^"=1_data
msks:(+/rng=/:(-1;1)+)@/:/:spls
f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
str:(1_x)*~|/t
((+/0<n)+*x),str+spl}
:(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# splsIt was a pleasant surprise that a single fold could solve both parts.
-
CW: Advent of Code 2025, day 7 in K
rng:!#*data:0:"07.in"
spls:l@&0<#'l:&'"^"=1_data
msks:(+/rng=/:(-1;1)+)@/:/:spls
f:{spl:+/(n@&0<n)*msks[y]@&0<n:|/+t:(1_x)*/:rng=/:spls[y]
str:(1_x)*~|/t
((+/0<n)+*x),str+spl}
:(one;two):(*:;+/1_)@\:(0,"S"=*data) f/!# splsIt was a pleasant surprise that a single fold could solve both parts.
-
CW: Advent of Code 2025, day 6 in K
d:0:"06.in"
op:(+/;*/)@"*"=op@&~" "=op:*|d
:one:+/op@'+.'1_|d
:two:+/op@'n 1_'.=+\~n:0,.'+|1_|dThe fact that the input file was nearly valid K was helpful.
-
CW: Advent of Code 2025, day 6 in K
d:0:"06.in"
op:(+/;*/)@"*"=op@&~" "=op:*|d
:one:+/op@'+.'1_|d
:two:+/op@'n 1_'.=+\~n:0,.'+|1_|dThe fact that the input file was nearly valid K was helpful.
-
CW: Advent of Code 2025, day 6 in K
d:0:"06.in"
op:(+/;*/)@"*"=op@&~" "=op:*|d
:one:+/op@'+.'1_|d
:two:+/op@'n 1_'.=+\~n:0,.'+|1_|dThe fact that the input file was nearly valid K was helpful.
-
CW: Advent of Code 2025, day 6 in K
d:0:"06.in"
op:(+/;*/)@"*"=op@&~" "=op:*|d
:one:+/op@'+.'1_|d
:two:+/op@'n 1_'.=+\~n:0,.'+|1_|dThe fact that the input file was nearly valid K was helpful.
-
CW: Advent of Code 2025, day 6 in K
d:0:"06.in"
op:(+/;*/)@"*"=op@&~" "=op:*|d
:one:+/op@'+.'1_|d
:two:+/op@'n 1_'.=+\~n:0,.'+|1_|dThe fact that the input file was nearly valid K was helpful.
-
Time based One Time Password in #Jlang
-
Why J? (The programming language) https://code.jsoftware.com/wiki/Essays/WhyJ
#jlang #apljk -
CW: Advent of Code Day 25 - APL
d←{⌊5÷⍨⍵+⍺}
g←{⍵=0:''⋄r←5|⍵⋄r=3:'=',∇2d⍵⋄r=4:'-',∇1d⍵⋄(⍕r),∇0d⍵}
⌽1↓g+/∊{((⊂'210-='⍳⌽⍵)⌷3-⍳5)×5*⍳⍴⍵}¨⊃⎕NGET'input'1It's over. It's done. Whew!
Not exactly elegant but it works. I might revisit it at a later time!
-
I just completed "Rucksack Reorganization" - Day 3 - Advent of Code 2022 #AdventOfCode https://adventofcode.com/2022/day/3
https://github.com/AshyIsMe/adventofcode/blob/main/adventofcode2022.ijs
#jlang #apljk -
I had a go at explaining forks, hooks and cap in J:
https://gist.github.com/AshyIsMe/12449fb69ad23b5d74d8989b293fe09d
#jlang #apljk -
#adventofcode is on! Of course day 1 is a single line of J. #jlang #apljk
-
Well, I think it's time to re-watch Tracy Harms' J Programming Language talk again:
https://youtu.be/RWYkx6-L04Q
#jlang #apljk #array -
This is a great read about j https://zserge.com/posts/j/
#jlang #apljk