#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.
-
CW: Advent of Code 2025, day 5 in K
nr:*&~#'d:0:"05.in"
rng@:<rng:`I$"-"\'nr# d
ids:`I$(nr+1)_d
merge:{:[~#:y
,x
x[1]<y[0;0]-1
(,x),o[*y;1_y]
o[x[0],(x[1]|y[0;1])
1_y]]}
:one:+/|/+({~(z<x)|z>y}.'rng)@\:/:ids
:two:+/1+--/'merge[*rng;1_rng] -
CW: Advent of Code 2025, day 5 in K
nr:*&~#'d:0:"05.in"
rng@:<rng:`I$"-"\'nr# d
ids:`I$(nr+1)_d
merge:{:[~#:y
,x
x[1]<y[0;0]-1
(,x),o[*y;1_y]
o[x[0],(x[1]|y[0;1])
1_y]]}
:one:+/|/+({~(z<x)|z>y}.'rng)@\:/:ids
:two:+/1+--/'merge[*rng;1_rng] -
CW: Advent of Code 2025, day 5 in K
nr:*&~#'d:0:"05.in"
rng@:<rng:`I$"-"\'nr# d
ids:`I$(nr+1)_d
merge:{:[~#:y
,x
x[1]<y[0;0]-1
(,x),o[*y;1_y]
o[x[0],(x[1]|y[0;1])
1_y]]}
:one:+/|/+({~(z<x)|z>y}.'rng)@\:/:ids
:two:+/1+--/'merge[*rng;1_rng] -
CW: Advent of Code 2025, day 5 in K
nr:*&~#'d:0:"05.in"
rng@:<rng:`I$"-"\'nr# d
ids:`I$(nr+1)_d
merge:{:[~#:y
,x
x[1]<y[0;0]-1
(,x),o[*y;1_y]
o[x[0],(x[1]|y[0;1])
1_y]]}
:one:+/|/+({~(z<x)|z>y}.'rng)@\:/:ids
:two:+/1+--/'merge[*rng;1_rng] -
CW: Advent of Code 2025, day 5 in K
nr:*&~#'d:0:"05.in"
rng@:<rng:`I$"-"\'nr# d
ids:`I$(nr+1)_d
merge:{:[~#:y
,x
x[1]<y[0;0]-1
(,x),o[*y;1_y]
o[x[0],(x[1]|y[0;1])
1_y]]}
:one:+/|/+({~(z<x)|z>y}.'rng)@\:/:ids
:two:+/1+--/'merge[*rng;1_rng] -
CW: Advent of Code 2025, day 4 in K
pad:+z'+(z:0,|0,|:)'
d:pad"@"=0:"04.in"
sh:{y w!x+!w:#:y}
eight:(n w@;n e@;s w@;s e@
e:+s@+:
w:+n@+:
n:sh[1;]
s:sh[-1;])
acc:{x*4>+/eight@\:x}
:one:+//acc d
:two:+//d-{x*~acc x}/darray problems 🤝 array programming languages
-
CW: Advent of Code 2025, day 4 in K
pad:+z'+(z:0,|0,|:)'
d:pad"@"=0:"04.in"
sh:{y w!x+!w:#:y}
eight:(n w@;n e@;s w@;s e@
e:+s@+:
w:+n@+:
n:sh[1;]
s:sh[-1;])
acc:{x*4>+/eight@\:x}
:one:+//acc d
:two:+//d-{x*~acc x}/darray problems 🤝 array programming languages
-
CW: Advent of Code 2025, day 4 in K
pad:+z'+(z:0,|0,|:)'
d:pad"@"=0:"04.in"
sh:{y w!x+!w:#:y}
eight:(n w@;n e@;s w@;s e@
e:+s@+:
w:+n@+:
n:sh[1;]
s:sh[-1;])
acc:{x*4>+/eight@\:x}
:one:+//acc d
:two:+//d-{x*~acc x}/darray problems 🤝 array programming languages
-
CW: Advent of Code 2025, day 4 in K
pad:+z'+(z:0,|0,|:)'
d:pad"@"=0:"04.in"
sh:{y w!x+!w:#:y}
eight:(n w@;n e@;s w@;s e@
e:+s@+:
w:+n@+:
n:sh[1;]
s:sh[-1;])
acc:{x*4>+/eight@\:x}
:one:+//acc d
:two:+//d-{x*~acc x}/darray problems 🤝 array programming languages
-
CW: Advent of Code 2025, day 4 in K
pad:+z'+(z:0,|0,|:)'
d:pad"@"=0:"04.in"
sh:{y w!x+!w:#:y}
eight:(n w@;n e@;s w@;s e@
e:+s@+:
w:+n@+:
n:sh[1;]
s:sh[-1;])
acc:{x*4>+/eight@\:x}
:one:+//acc d
:two:+//d-{x*~acc x}/darray problems 🤝 array programming languages
-
CW: Advent of Code 2025, day 3 in K
w:#*data:`I$''0:"03.in"
step:{(acc;len;row):x
:[len=# acc
x
(acc,row i
len
row*~(!w)<1+i:*>((# acc)+1+w-len)# row)]}
solve:{+/{`I$,/$*step/(();x;y)}[x;]'data}
:(one;two):solve'2 12Great fun today.
-
CW: Advent of Code 2025, day 3 in K
w:#*data:`I$''0:"03.in"
step:{(acc;len;row):x
:[len=# acc
x
(acc,row i
len
row*~(!w)<1+i:*>((# acc)+1+w-len)# row)]}
solve:{+/{`I$,/$*step/(();x;y)}[x;]'data}
:(one;two):solve'2 12Great fun today.
-
CW: Advent of Code 2025, day 3 in K
w:#*data:`I$''0:"03.in"
step:{(acc;len;row):x
:[len=# acc
x
(acc,row i
len
row*~(!w)<1+i:*>((# acc)+1+w-len)# row)]}
solve:{+/{`I$,/$*step/(();x;y)}[x;]'data}
:(one;two):solve'2 12Great fun today.
-
CW: Advent of Code 2025, day 3 in K
w:#*data:`I$''0:"03.in"
step:{(acc;len;row):x
:[len=# acc
x
(acc,row i
len
row*~(!w)<1+i:*>((# acc)+1+w-len)# row)]}
solve:{+/{`I$,/$*step/(();x;y)}[x;]'data}
:(one;two):solve'2 12Great fun today.
-
CW: Advent of Code 2025, day 3 in K
w:#*data:`I$''0:"03.in"
step:{(acc;len;row):x
:[len=# acc
x
(acc,row i
len
row*~(!w)<1+i:*>((# acc)+1+w-len)# row)]}
solve:{+/{`I$,/$*step/(();x;y)}[x;]'data}
:(one;two):solve'2 12Great fun today.
-
CW: Advent of Code 2025, day 1 in K
data:0:"01.in"
sign:+/(-1;1)*"LR"=\:data[;0]
count:+/0=100!
:one:count pos:+\50,sign*rot:`I$1_'data
base:1_{y&-1+x}':pos
:two: +/base {count x+1+!y}' rotThis should be executable using https://codeberg.org/ngn/k
-
CW: Advent of Code 2025, day 1 in K
data:0:"01.in"
sign:+/(-1;1)*"LR"=\:data[;0]
count:+/0=100!
:one:count pos:+\50,sign*rot:`I$1_'data
base:1_{y&-1+x}':pos
:two: +/base {count x+1+!y}' rotThis should be executable using https://codeberg.org/ngn/k
-
CW: Advent of Code 2025, day 1 in K
data:0:"01.in"
sign:+/(-1;1)*"LR"=\:data[;0]
count:+/0=100!
:one:count pos:+\50,sign*rot:`I$1_'data
base:1_{y&-1+x}':pos
:two: +/base {count x+1+!y}' rotThis should be executable using https://codeberg.org/ngn/k
-
CW: Advent of Code 2025, day 1 in K
data:0:"01.in"
sign:+/(-1;1)*"LR"=\:data[;0]
count:+/0=100!
:one:count pos:+\50,sign*rot:`I$1_'data
base:1_{y&-1+x}':pos
:two: +/base {count x+1+!y}' rotThis should be executable using https://codeberg.org/ngn/k
-
CW: Advent of Code 2025, day 1 in K
data:0:"01.in"
sign:+/(-1;1)*"LR"=\:data[;0]
count:+/0=100!
:one:count pos:+\50,sign*rot:`I$1_'data
base:1_{y&-1+x}':pos
:two: +/base {count x+1+!y}' rotThis should be executable using https://codeberg.org/ngn/k
-
This is quite a nice intro to the k programming language:
https://github.com/gitonthescene/ngnk-libs/tree/master/tutorial
#apljk #k -
This is quite a nice intro to the k programming language:
https://github.com/gitonthescene/ngnk-libs/tree/master/tutorial
#apljk #k -
This is quite a nice intro to the k programming language:
https://github.com/gitonthescene/ngnk-libs/tree/master/tutorial
#apljk #k -
This is quite a nice intro to the k programming language:
https://github.com/gitonthescene/ngnk-libs/tree/master/tutorial
#apljk #k -
I will be in Toronto in the week of April 15th. I’d love to meet you and chat. Get in touch, let’s grab a lunch. A rough list of interests and potential conversation starters → #SoftwareArchitecture #DataDrivenProgramming #FunctionalProgramming #ProgrammingLanguages #Clojure #Erlang #APLJK #SmallWeb #DarkSouls #Coffee #StayAtHomeDad #Kettlebells #Toronto
-
I will be in Toronto in the week of April 15th. I’d love to meet you and chat. Get in touch, let’s grab a lunch. A rough list of interests and potential conversation starters → #SoftwareArchitecture #DataDrivenProgramming #FunctionalProgramming #ProgrammingLanguages #Clojure #Erlang #APLJK #SmallWeb #DarkSouls #Coffee #StayAtHomeDad #Kettlebells #Toronto
-
I will be in Toronto in the week of April 15th. I’d love to meet you and chat. Get in touch, let’s grab a lunch. A rough list of interests and potential conversation starters → #SoftwareArchitecture #DataDrivenProgramming #FunctionalProgramming #ProgrammingLanguages #Clojure #Erlang #APLJK #SmallWeb #DarkSouls #Coffee #StayAtHomeDad #Kettlebells #Toronto
-
I will be in Toronto in the week of April 15th. I’d love to meet you and chat. Get in touch, let’s grab a lunch. A rough list of interests and potential conversation starters → #SoftwareArchitecture #DataDrivenProgramming #FunctionalProgramming #ProgrammingLanguages #Clojure #Erlang #APLJK #SmallWeb #DarkSouls #Coffee #StayAtHomeDad #Kettlebells #Toronto
-
I will be in Toronto in the week of April 15th. I’d love to meet you and chat. Get in touch, let’s grab a lunch. A rough list of interests and potential conversation starters → #SoftwareArchitecture #DataDrivenProgramming #FunctionalProgramming #ProgrammingLanguages #Clojure #Erlang #APLJK #SmallWeb #DarkSouls #Coffee #StayAtHomeDad #Kettlebells #Toronto
-
CW: AoC Day 10 Part 1 in Uiua
Map ← ⍥(⍉≡(⊂⊂⊙:.@.))2 ⊜∘≠@\n.&fras"10.in"
Inf ← 9999 # applied infinity
F ← +×Inf=0./+⊞=:Map
D ← F"|LJ"
U ← F"|7F"
R ← F"-J7"
L ← F"-FL"
M ← ↧+1×
TD ← M D ↻¯1.
TU ← M U ↻ 1.
TR ← M R≡↻¯1.
TL ← M L≡↻ 1.
T ← TU TL TD TR
-1/↥/↥×≠Inf⍢(T.⊙;)(¬≍)⊃∘(×0) F"S" -
CW: AoC Day 10 Part 1 in Uiua
Map ← ⍥(⍉≡(⊂⊂⊙:.@.))2 ⊜∘≠@\n.&fras"10.in"
Inf ← 9999 # applied infinity
F ← +×Inf=0./+⊞=:Map
D ← F"|LJ"
U ← F"|7F"
R ← F"-J7"
L ← F"-FL"
M ← ↧+1×
TD ← M D ↻¯1.
TU ← M U ↻ 1.
TR ← M R≡↻¯1.
TL ← M L≡↻ 1.
T ← TU TL TD TR
-1/↥/↥×≠Inf⍢(T.⊙;)(¬≍)⊃∘(×0) F"S" -
CW: AoC Day 10 Part 1 in Uiua
Map ← ⍥(⍉≡(⊂⊂⊙:.@.))2 ⊜∘≠@\n.&fras"10.in"
Inf ← 9999 # applied infinity
F ← +×Inf=0./+⊞=:Map
D ← F"|LJ"
U ← F"|7F"
R ← F"-J7"
L ← F"-FL"
M ← ↧+1×
TD ← M D ↻¯1.
TU ← M U ↻ 1.
TR ← M R≡↻¯1.
TL ← M L≡↻ 1.
T ← TU TL TD TR
-1/↥/↥×≠Inf⍢(T.⊙;)(¬≍)⊃∘(×0) F"S"