« first day (1855 days earlier)      last day (802 days later) » 

12:20 AM
@LdBeth I wonder what it's for
 
 
1 hour later…
1:34 AM
@rak1507 It's something you'd have on a lisp machine, parsing various kinds of time/date text formats
 
 
5 hours later…
7:01 AM
Trying to make {⍸2=+⌿0=∘.|⍨⍳⍵} tacit. Managed to turn it into ⍸2=(+⌿0=∘.|⍨∘⍳), and then ⍸2=∘(+⌿)0=∘.|⍨∘⍳. But is there a way to get rid of the parens altogether?
 
No, I don't think so
You can use an old golfer's trick
⍸2=1⊥0=∘.|⍨∘⍳
1⊥ is summation here and continues the forks :)
 
Ah lovely, thank you
I was assuming it was always possible to write a train parens-free
"Decode in base 1" - that's quite clever :)
 
7:21 AM
Or ⍸2=0+.=∘.|⍨⍤⍳
∘.|⍨⍤⍳ and ∘.|⍨∘⍳ are identical semantically (when monadic), but i find the former nicer to think about.
 
What do you mean by "nicer to think about"? Aren't they exactly the same in the monadic case?
I've been going to by default because it looks simpler visually (which is probably not the best reason to choose something).
I'm not sure if I'm thinking about this in the proper way, but f⍤g feels like it's doing something simpler in the dyadic case: apply g to the arguments, then apply f to the result of that.
Whereas if you were to describe f∘g in words, it would be more of a mouthful.
 
7:41 AM
Back, ⍤ is "atop" in my brain, f (g X). So using ∘ for it feels wrong, I prefer to think about it as a lapse of judgement on Dyalog's part
∘ is a nicer symbol for atop anyway, but It'll have nice symmetry with before once that's added (⍛)
Well Dyadically they are different, f (X g Y) vs X f (g Y)

The former being ⍤ and more atop-y, hence the association
Dyalog should've made monadic ∘ Y f (g Y) imo
 
Would monadic be (g Y) f g Y then?
 
Probably not, I haven't thought about what it should be. I think ⍥ is atop monadically in BQN too - which feels like a mistake
But there isn't much it can be
I very rarely see f⍥g⍨ Y
 
8:02 AM
Anyway, I think I'm starting to grok tacit. Sometimes I can immediately recognize that I want a , etc, although it can still take me some time to figure out where to put what exactly.
where to put what? what to put where?
Anyway, yeah. The progress feels nice.
 
Yes, I forgot to say that. You've picked it up extremely quickly
 
I've been learning on and off for more than a year actually. This is what got me interested: reddit.com/r/adventofcode/comments/k8zdx3/…
Thought it was garbled text at first :)
When I found out it wasn't, I was immediately hooked.
(I think it was mostly because of the s.)
 
Oh, I see. Learning tacit is unfortunate, you can't use it casually because you do not understand it, and you don't understand it because you can't use it, once you get over the initial curve the growth of learning becomes exponential
 
Think that's true of many other things too.
 
Yeah, I think this is APL's only feature that's like that though
 
8:17 AM
It felt like a bunch of arbitrary rules at first, and seeing examples like 5(+,-)2 in the APL Wiki helped - you can read it as "plus and minus". That answered the "why" for me.
I should add that ]box on -trains=tree has been extremely helpful. Also it looks pretty ;)
 
Yeah, I like tacit because it expresses some ideas very naturally. And reveals patterns in your code
 
I don't think I would otherwise have thought of programming as building a tree of functions. It really is beautiful.
 
8:51 AM
@ZtA0 using )COPY you can append two workspaces. Or maybe I misunderstood your question
 
9:28 AM
@PyGamer0 OOooo one more thing. i want support for quaternions :D
 
@BrianBED uh would that be useful
might as well add symbolic algebra to APL lol
there must be a SymAPL
 
9:48 AM
right now i really want to add a way to get my quardinates in my game to be imaginary but imaginary numbers with 3 axies don't even have neat properties so i guess i'll settle for trigonometry :/
i do wanna make my quardinates for my 2d version be imaginary tho. that'd be cool
 
i should actually try making something in APL for once
 
yee its super fun. i don't wanna go back to python :)
if i ever try a new lang im prob gonna try rust but honestly if i can get good at doing stuff in apl then i'd rather do it apl
 
@PyGamer0 the question of course; is WHAT should i make lol
 
@PyGamer0 i started with making some of my old python starter projects in apl, and then i just let my imagine carry me beyond!
 
10:11 AM
Here's a good one for APL: make a sliding tiles puzzle solver (en.wikipedia.org/wiki/Sliding_puzzle)
 
hm i dont think my 2 brain cells can solve that lol
 
It looks easy, but isn't.
 
0 2 1
3 4 7
6 8 5
ill say ^ is the puzzle
where 0 denotes the empty piece
 
      state←¯1+4 4⍴?⍨16
      state
┌→──────────┐
↓ 0 15  5  8│
│14 11  2  7│
│ 4  3  1  6│
│ 9 12 13 10│
└~──────────┘

      moves state
┌→────────────────────────────┐
│ ┌→──────────┐ ┌→──────────┐ │
│ ↓15  0  5  8│ ↓14 15  5  8│ │
│ │14 11  2  7│ │ 0 11  2  7│ │
│ │ 4  3  1  6│ │ 4  3  1  6│ │
│ │ 9 12 13 10│ │ 9 12 13 10│ │
│ └~──────────┘ └~──────────┘ │
└∊────────────────────────────┘
 
1 2 3
4 5 6
7 8 0
^ and that is the solved version
@xpqz ok so does that output all possible moves?
 
10:23 AM
Yeah.
That can be done nicely in APL.
Solving it though...
 
@xpqz my brain has stopped working already
 
why?
it's just manhattan distance of permutations.
 
manhattan distance?
 
That's a decent stab that will get to to 4x4.
A taxicab geometry is a form of geometry in which the usual distance function or metric of Euclidean geometry is replaced by a new metric in which the distance between two points is the sum of the absolute differences of their Cartesian coordinates. The taxicab metric is also known as rectilinear distance, L1 distance, L1 distance or ℓ 1 {\displaystyle \ell _{1}} norm (see Lp space), snake distance, city block distance, Manhattan distance or Manhattan length, with corresponding variations in the name...
 
just ask for input wasd and then find where 0 is with 0⍳board and then if the input is "a"
then flip 0 and the number on the left... well in my head sounds easy but idk. you also need to catch errors because of like... if you use "d" to move the right of 0 youd get an error
oh wait... ahhh a solver for it
 
10:28 AM
Was thinking more of an automated solver giving you the sequence of moves.
 
right that sounds harder
 
how do i generate all permutations of an array?
 
many possibilities!
the most convenient one is dfns.pmat
 
For 5x5 manhattan distance isn't sufficient.
 
how do i use dfns library on tryAPL.org?
 
10:35 AM
@xpqz here's my bad attempt {⍵~⍨⍥⊆∪{⊖⍉⍵}\{0::⍵⋄⌽@((0 0)(0 1)+⍸0=⍵)⊢⍵}¨{⌽⍉⍵}\4⍴⊂⍵}
 
Only some are available, the workspace on that site is only 512kbs which won't be sufficient for that amount of permutations, anyway
 
@PyGamer0 you don't
 
@rak1507 My ungolfed mess was:
moves←{
     d←(0 1)(1 0)(0 ¯1)(¯1 0)      ⍝ Move offsets
     m←⍵
     {⌽@i ⍵⊢m}¨(,⍳⍴m)∩d+⊂i←⊃⍸0=m
 }
 
let me try making a permutations generator first
 
@xpqz yeah (,⍳⍴m)∩ nice
 
10:37 AM
surprised nobody used stencil
 
I tried but it wasn't nice
 
i wonder if it'd be neater for ○ to mean tou instead of pi. like a full sircle radius is ○2 with a radius of 1, and ○ is a full sircle not a half one... ¯\_(ツ)_/¯
 
pi is useful in a lot of formulas
i guess we'd be writing ○.5 instead
 
⎕IO←0
Permute←{⍵[?⍨≢⍵]}
Permutations←{x←⊂⍵⋄x{a←Permute⍵⋄a∊⍺:⍺∇⍵⋄⍺,⊂a}←⍵⋄x}
^ i really dont know what i was thinking here
 
 
1 hour later…
12:04 PM
{¯3○÷/⍵}1 1
this is a way to get the radians of a point with an x and y... but i have no idea how to avoid the test case 1 0 where it gets a "cant devide by 0" error. i cant find any way of fixing it except something like this (⎕io is 0): `{0=1⊃⍵:¯3○÷/1E¯12,⍨⊃⍵ ⋄ ¯3○÷/⍵}1 0` but it's incredibly ugly
 
what you really want is a two argument arctangent.
sometimes called atan2
 
yea thats what {¯3○÷/⍵} is
i looked here for the formula math.stackexchange.com/questions/1201337/…
 
that's not what atan2 is.
because it fails for one of the defined cases
you could use the inner product formula the author has showed too.
 
oh so how do i do atan2?
 
APL doesn't have it as a built-in. you must special case it according to the following definition:
 
12:17 PM
aw
well thanks
 
you could use vectors though
 
yea havent learned that yet
 
using the inner product formula
 
ok wait ill google a bit. ill prob figure it out
 
it's given in the post you linked.
 
12:18 PM
i did also think about using 12○xJy
which works ¯\_(ツ)_/¯
 
that's a smart idea
 
:D
 
phase of the complex number is defined in terms of arctangent
 
yep
{12○+/1 0J1×⍵}1 1
tada!!
 
:)
⋄{¯9 ¯11+.○⍵}3 3
 
12:22 PM
@KamilaSzewczyk 3J3
 
u sure that makes sense?
{12○+/1 0J1×⍵}3 3
0.7853981634
{12○1 0J1+.×⍵}3 3
this works too
 
⋄57.2958×12○3J3
 
@KamilaSzewczyk 45.00001609
 
seems to be correct
 
 
1 hour later…
1:53 PM
dtr←○180÷⍨⊢
this is a way to get degrees to radians...
now i reeaaalllyyy want a radians to degrees again and i wanted to do `dtr⍣¯1` but if the input is 0 it gets a devide by 0 error...
i tried `dtr←○0.005555555556×⊢` and the 0.0055 is just ÷180, and i was expecting it wouldn't get a devide by 0 because it doesn't devide but it still gets the same error. any smart idea how to fix this or should i just make a seprate function "rtd" which has the exception? again... reallyyyyy inelegent :(
 
@BrianBED huh, that's weird
it's (○⍣¯1) 0 that fails
 
Side note: dtr←○÷∘180
 
you can do dtr←(180÷⍨○1)×⊢ but that's way less cool
 
@dzaima dyalog bug?
 
probably
 
2:02 PM
@dzaima thanks so much. its way better than my exception idea
 
 
3 hours later…
4:39 PM
https://imgur.com/K26AhCp
have you ever pressed alt+p in explorer? pretty neat :)
it works for pdfs, word documents, and lots more :o
 
 
3 hours later…
7:19 PM
I usually do “type” in terminal :D
 
7:55 PM
⋄ -/0 ⍴1
 
@LdBeth 0
 
well it is surprising, because subtraction has no identity
It is probably because -n equal to 0-n
 

« first day (1855 days earlier)      last day (802 days later) »