output 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. dust particles [(5, 6), (9, 4), (7, 2), (1, 2), (5, 2), (2, 0), (3, 8), (6, 7), (8, 2), (7, 4)]
  2. dust sorted [(2, 0), (1, 2), (5, 2), (7, 2), (8, 2), (5, 6), (3, 8), (7, 4), (9, 4), (6, 7)]
  3. next closest particle (2, 0) at index 0
  4. robot is at 0 0 driving to 2 0 with a dist of 2
  5. (2, 0) popped
  6. next closest particle (1, 2) at index 0
  7. robot is at 2 0 driving to 1 2 with a dist of 3
  8. (1, 2) popped
  9. next closest particle (5, 2) at index 0
  10. robot is at 1 2 driving to 5 2 with a dist of 4
  11. (5, 2) popped
  12. next closest particle (3, 8) at index 3
  13. robot is at 5 2 driving to 3 8 with a dist of 8
  14. (3, 8) popped
  15. next closest particle (7, 2) at index 0
  16. robot is at 3 8 driving to 7 2 with a dist of 10
  17. (7, 2) popped
  18. next closest particle (5, 6) at index 1
  19. robot is at 7 2 driving to 0 0 with a dist of 9
  20. recharged!
  21. next closest particle (8, 2) at index 0
  22. robot is at 0 0 driving to 8 2 with a dist of 10
  23. (8, 2) popped
  24. next closest particle (7, 4) at index 1
  25. robot is at 8 2 driving to 7 4 with a dist of 3
  26. (7, 4) popped
  27. next closest particle (5, 6) at index 0
  28. robot is at 7 4 driving to 5 6 with a dist of 4
  29. (5, 6) popped
  30. next closest particle (9, 4) at index 0
  31. robot is at 5 6 driving to 0 0 with a dist of 11
  32. recharged!
  33. next closest particle (9, 4) at index 0
  34. robot is at 0 0 driving to 9 4 with a dist of 13
  35. (9, 4) popped
  36. next closest particle (6, 7) at index 1
  37. robot is at 9 4 driving to 0 0 with a dist of 13
  38. recharged!
  39. next closest particle (6, 7) at index 0
  40. robot is at 0 0 driving to 6 7 with a dist of 13
  41. (6, 7) popped
  42. []