--- xlib_bw_120x80w2c.c	2026-01-24 10:41:08.110113558 +0100
+++ xlib_bw_120x80w2d.c	2026-01-24 10:41:14.939113345 +0100
@@ -27,9 +27,12 @@
   enum _dir dir;
   int dx; // dest
   int dy;
+  int w;
 };
 
-struct _elem elems[10];
+struct _elem elems[80];
+
+#define MAX_ELEMS 80
 
 struct _controler {
   unsigned int x;
@@ -55,6 +58,7 @@
 
 struct _controler controlers[] = {
   { W+5,  4, "p" },
+  { W+5, 20, "s" },
 };
 
 struct _plot {
@@ -125,27 +129,29 @@
 void
 find_collectible()
 {
-  for (int e = 0; e < sizeof(elems) / sizeof(struct _elem); e++) {
+  for (int e = 0; e < MAX_ELEMS; e++) {
     struct _elem *elm = &elems[e];
-    int d;
-    for (d = 0; d < sizeof(collectibles) / sizeof(struct _clb); d++) {
-      struct _clb *clb = &collectibles[d];
-      if (clb->x == -1 && clb->y == -1) continue ;
-      elm->dx = clb->x;
-      elm->dy = clb->y;
-      break ;
-    }
-    if (elm->dx != -1 && elm->dy != -1) {
-      for (int l = d+1; l < sizeof(collectibles) / sizeof(struct _clb); l++) {
-        struct _clb *clb = &collectibles[l];
-        int n1;
-        int n2;
+    if (elm->w > 0) {
+      int d;
+      for (d = 0; d < sizeof(collectibles) / sizeof(struct _clb); d++) {
+        struct _clb *clb = &collectibles[d];
         if (clb->x == -1 && clb->y == -1) continue ;
-        n1 = mana_dist(elm->x, elm->y, elm->dx, elm->dy);
-        n2 = mana_dist(elm->x, elm->y, clb->x, clb->y);
-        if (n2 < n1) {
-          elm->dx = clb->x;
-          elm->dy = clb->y;
+        elm->dx = clb->x;
+        elm->dy = clb->y;
+        break ;
+      }
+      if (elm->dx != -1 && elm->dy != -1) {
+        for (int l = d+1; l < sizeof(collectibles) / sizeof(struct _clb); l++) {
+          struct _clb *clb = &collectibles[l];
+          int n1;
+          int n2;
+          if (clb->x == -1 && clb->y == -1) continue ;
+          n1 = mana_dist(elm->x, elm->y, elm->dx, elm->dy);
+          n2 = mana_dist(elm->x, elm->y, clb->x, clb->y);
+          if (n2 < n1) {
+            elm->dx = clb->x;
+            elm->dy = clb->y;
+          }
         }
       }
     }
@@ -225,7 +231,7 @@
 {
   for (int d = 0; d < sizeof(collectibles) / sizeof(struct _clb); d++) {
     struct _clb *clb = &collectibles[d];
-    if ((rand() % 160) == 0) {
+    if ((rand() % 140) == 0) {
       if (clb->x == -1 && clb->y == -1) {
         int x = rand() % (W - 1);
         int y = rand() % (H - 1);
@@ -256,24 +262,54 @@
 void
 init_elems()
 {
-  for (int e = 0; e < sizeof(elems) / sizeof(struct _elem); e++) {
+  for (int e = 0; e < MAX_ELEMS; e++) {
     struct _elem *elm = &elems[e];
-    elm->dx = -1;
-    elm->dy = -1;
-    elm->x = rand() % (W-1);
-    elm->y = rand() % (H-1);
-    elm->dir = rand() % (4);
+    if ((rand() % 8) == 0) {
+      elm->dx = -1;
+      elm->dy = -1;
+      elm->x = rand() % (W-1);
+      elm->y = rand() % (H-1);
+      elm->dir = rand() % (4);
+      elm->w = 100;
+    } else {
+      elm->w = 0;
+    }
   }
 }
 
 void
 mv_elems()
 {
-  for (int d = 0; d < sizeof(elems) / sizeof(struct _elem); d++) {
+  for (int d = 0; d < MAX_ELEMS; d++) {
     struct _elem *elm = &elems[d];
-    if (elm->dx != -1 && elm->dy != -1) {
-      elm->x = rand() % (W-1);
-      elm->y = rand() % (H-1);
+    if (elm->w > 0) {
+      if (elm->dx != -1 && elm->dy != -1) {
+        elm->x = rand() % (W-1);
+        elm->y = rand() % (H-1);
+      }
+    }
+  }
+}
+
+void
+split_elms()
+{
+  for (int d = 0; d < MAX_ELEMS; d++) {
+    struct _elem *elm = &elems[d];
+    if (elm->w > 300) {
+      for (int e = 0; e < MAX_ELEMS; e++) {
+        struct _elem *elm2 = &elems[e];
+        if (elm2->w == 0) {
+          elm2->dx = -1;
+          elm2->dy = -1;
+          elm2->x = elm->x;
+          elm2->y = elm->y;
+          elm2->dir = rand() % (4);
+          elm2->w = 100;
+          elm->w -= 100;
+          break;
+        }
+      }
     }
   }
 }
@@ -429,10 +465,12 @@
 void
 print_elms()
 {
-  for (int d = 0; d < sizeof(elems) / sizeof(struct _elem); d++) {
+  for (int d = 0; d < MAX_ELEMS; d++) {
     struct _elem *elm = &elems[d];
-    printf("# %2d: %3d, %3d ; %d ", d, elm->x, elm->y, elm->dir);
-    printf("; %2d, %2d\n", elm->dx, elm->dy);
+    if (elm->w > 0) {
+      printf("# %2d: %3d, %3d ; %d ; %3d ", d, elm->x, elm->y, elm->dir, elm->w);
+      printf("; %2d, %2d\n", elm->dx, elm->dy);
+    }
   }
   printf("\n");
 }
@@ -573,32 +611,38 @@
     }
 
     s++;
-    if ((s % 80) == 0) {
+    if ((s % 60) == 0) {
       print_collectible();
       print_elms();
     }
 
     /* For each elm */
-    for (int d = 0; d < sizeof(elems) / sizeof(struct _elem); d++) {
+    for (int d = 0; d < MAX_ELEMS; d++) {
       struct _elem *elm = &elems[d];
-      XDrawElem(ximg, map, elm->x, elm->y);
-      if (elm->dx == -1 && elm->dy == -1) {
-        dir_move(elm);
-        pos_wrap(elm);
-        rand_turn(elm);
-        if ((rand() % 70) == 0)
-          find_clb_elem(elm);
-      } else {
-        int r;
-        r = dir_dest(elm);
-        if (r) {
+      if (elm->w > 0) {
+        XDrawElem(ximg, map, elm->x, elm->y);
+        elm->w--;
+        if (elm->dx == -1 && elm->dy == -1) {
           dir_move(elm);
-        } else { // dest-reach'd
-          int r = rem_collectible(elm->x, elm->y);
-          if (r) printf(" [%d] <= (%d,%d)\n", d, elm->x, elm->y);
+          pos_wrap(elm);
           rand_turn(elm);
-          elm->dx = -1;
-          elm->dy = -1;
+          if ((rand() % 60) == 0)
+            find_clb_elem(elm);
+        } else {
+          int r;
+          r = dir_dest(elm);
+          if (r) {
+            dir_move(elm);
+          } else { // dest-reach'd
+            int r = rem_collectible(elm->x, elm->y);
+            if (r) {
+              printf(" [%d] <= (%d,%d)\n", d, elm->x, elm->y);
+              elm->w += 100;
+            }
+            rand_turn(elm);
+            elm->dx = -1;
+            elm->dy = -1;
+          }
         }
       }
     }
@@ -636,6 +680,9 @@
           case 'b':
             init_map();
             break;
+          case 's':
+            split_elms();
+            break;
         }
       }
     }
