3b1b had a problem with bacteria understandable, 3b1b- we all do when we get sick but bacteria is important for gut health here is an interactive simulation of the bacteria problem: the bacteria can duplicate itsel, creating a copy above and to the right of it- you must try to leave the first 4x4 square area this is impossible, by the way i didnt believe it at first until i made an interactive
click the bacteria to duplicate use WASD to move the camera click space to automate the bacteria division (more on this at the end) original problem: https://www.youtube.com/watch?v=d0ai33oqqDE original solution: https://www.youtube.com/watch?v=Qoes9bTJtn0 how it works: there is one list which holds the positions of every single bacteria the arrangement of the positions goes as follows 1,1 - 1 2,1 - 2 1,2 - 3 3,1 - 4 2,2 - 5 1,3 - 6 on so on, it fills every diagonal after diagonal the formula for this first calculates the layer and then the x and y coordinate n is the index s is the layer (side note: the layer shown for the cursor position is actually s-1, because that doesnt make sense that 1,1 is on layer 2 not 1...) layer: s=ceil((1+sqrt(8n+1))/2) position: x=n-(((s-1)*(s-2))/2) y=s-x inverse of this: s=x+y n=x+(((s-1)*(s-2))/2) how the bacteria autodivider works is that it checks every bacteria and keeps track of the one "closest to center" it first checks if the layer is smaller or not and if it is, it checks if the bacteria is closer to the center by |x-y| vs the smallest ones |x-y| which is how i defined it. some nerd out there probably has a problem with how i did this but, please, i wanna see it done better- i challenge you all to make a script that gets the optimal output, aka the first 3x3 area should be cleared EXCEPT the 3,3 spot- which is shown in the 3b1b video... though, again- it takes unlimited time and its actually impossible which he doesnt state because the rows of (int, 1) and (1, int) can only ever have ONE bacteria at a time, therefore its not something you CAN add up lol. i hope none of that helped at all, not really... or maybe yeah- i hope none of you found this fun >:)