oh right my stupid priority queue is backed by a linked list and has insertion being O(n) (because I wanted O(1) removing), time to learn heaps first i guess ಠ_ಠ
@ngn there's a linkedlist of the points to draw left-to-right, and a priority queue of the distances between adjacent points so I'd know where I need to add precision (or remove it in the case of zooming out)
the nodes of both link back to each other so it's pretty easy to remove & add points
APL isn't well suited at all for doing any log(n) operations though
@ngn I start by evaluating the leftmost and rightmost ones on the screen and evaluate the greatest gaps, so at every point in time the point density everywhere is about the same
@dzaima theoretically a heap data structure could be implemented with in-place updates - indexed assignment and ,← but i don't know how complicated the code will end up
wait really the path needed to take in a binary heap to find the place to create a new node at is the reverse of the bijective base 2 of the size before adding? :D
@Cowsquack I have my APL added as a library to the Processing sketch and I set a variable to the global Scope object that's a custom APLMap object with its own getters & setters
@Cowsquack P.LM.P:← if left mouse button is pressed, return l,← mouse position. (Otherwise), then if ×≢l (aka does l have any elements), set a to the right argument. After that, set l to ⍬
the right argument to that is the result of G.ln a,⊂l - a,⊂l
I sat on that for way too long, having started with 123 chars :D
@Cowsquack because that shouldn't really be a thing since I haven't decided what to do with number color arguments
Processing does it very strangely with 0-255 being grayscale & everything else being RGB, so a segment of transparent colors is not actually transparent and I don't like that
@Cowsquack 0x80FF0000 is a 50% transparent red color. 0x00FF0000 is 100% transparent red color. 0x00000000 should be a 100% transparent black color, but instead is black. 0x00000080 is also gray, not transparent
how can I find an exact sequence of characters in a string? Ideally I'd like a function such as 'ab'∊'abc' to return 1 instead of 1 1 and 'ab'∊'acb' return 0.
@AttilaVrabecz you mean negative integers. by the way, you know this parses as !-(12+⎕CT), right? negatives in apl use the high minus: ¯12; and there's no difference between 12.0 and 12
I've been studying APL only a few weeks but I really like it. I tried to write simple functions to practice what I learn. This one tells me how much money I'm left with next 13 months if I withdraw W every month from initial capital of T.
R←T Money W
M←1 2 3 4 5 6 7 8 9 10 11 12 13
Months←'No...
@AttilaVrabecz interesting fact: in france and some french-speaking countries they define "positif" as ≥0 :)
as for 12.0 vs 12 - dyalog represents small integers as the smallest c type in which they fit - byte, short, or 32-bit int (all signed), but uses double for larger ones and fractional numbers
there's also ⎕FR←1287, but that's another story...
so (ignoring ⎕FR) "integers" are limited to 2^53
the transitions between byte/short/etc representations are transparent to the user - it's like having a single numeric type, not separate integer/floating point types like in k
oh, and i forgot to mention bit-booleans before "byte"
@nathanrogers {⊃∨/1 ⍵∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵} would be a more understandable dfn of that. If both arguments to . are vectors, A f.g B ←→ ⊃f/ A g B
(and if both arguments to . aren't vectors, it's magic, but that's unrelated to this)