B starts out empty, but in the full application, points would be added by actions later. C is a list of points. D is the combination of B & C through a 2-D list comprehension, but unfortunately, it breaks when B is empty. I expected the list comprehension to produce an empty list when any of its generators are empty.
But wait, there’s more. E is intended to be the first element of B combined with C, or an empty list when B is empty. I tried two ways, but no luck.
Adding any point, say (0,0), to B makes everything work. But I need it to work with B initially empty.
By the way, this all works if I replace points by scalars.
I assume that Desmos thinks of lists as containing numbers by default, and only ‘knows’ it contains points once there’s a point in it. I guess the two best workarounds would be to either have B=[(0,0)] initially, and then make sure that your action replaces that value when it is fired first of all; or to have lists B_x (empty), B_y (empty), C_x (all 1s), C_y (1…5), which are combined into D as ((bx+cx,by+cy) for bx=B_x, cx=C_x, …)
Yes, thanks. I had settled on the first, but finding an acceptable bonus point has been tricky and led to some bugs, so I was looking for a cleaner solution.
Yeah, I tried that. My bonus point was (Inf,inf), but compensating code is necessary. You compensated with a counter; I did it another way (adapting some interacting code in the real application: King’s Move).