Updated WolframAutomata's simulation length related CLI flags to match README.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Thu, 10 Jun 2021 22:09:47 +0000 (15:09 -0700)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Thu, 10 Jun 2021 22:09:47 +0000 (15:09 -0700)
hacks/WolframAutomata/WolframAutomata.c

index 36f1c05..25816a6 100644 (file)
@@ -359,7 +359,7 @@ WolframAutomata_init(Display * dpy, Window win)
 
     /* Set the number of generations to simulate before wiping the simulation */
     /* and re-running with new settings.                                      */
 
     /* Set the number of generations to simulate before wiping the simulation */
     /* and re-running with new settings.                                      */
-    if (get_boolean_resource(state->dpy, "random-num-generations", "Boolean")) {
+    if (get_boolean_resource(state->dpy, "random-length", "Boolean")) {
         /* By empirical observation, keep the product                         */
         /*      state->num_generations * state->cell_size                     */
         /* below 10,000 to avoid BadAlloc errors from the X server due to     */
         /* By empirical observation, keep the product                         */
         /*      state->num_generations * state->cell_size                     */
         /* below 10,000 to avoid BadAlloc errors from the X server due to     */
@@ -372,7 +372,7 @@ WolframAutomata_init(Display * dpy, Window win)
             state->num_generations = (state->dpy_height / state->cell_size) + 1;
         }
     } else {
             state->num_generations = (state->dpy_height / state->cell_size) + 1;
         }
     } else {
-        state->num_generations = get_integer_resource(state->dpy, "num-generations", "Integer");
+        state->num_generations = get_integer_resource(state->dpy, "length", "Integer");
     }
     /* The minimum number of generations is 2 since we must allocate enough   */
     /* space to hold the seed generation and at least one pass through        */
     }
     /* The minimum number of generations is 2 since we must allocate enough   */
     /* space to hold the seed generation and at least one pass through        */
@@ -504,7 +504,7 @@ WolframAutomata_draw(Display * dpy, Window win, void * closure)
 static const char * WolframAutomata_defaults[] = {
     "*delay-usec:         25000",
     "*admiration-delay:   5",
 static const char * WolframAutomata_defaults[] = {
     "*delay-usec:         25000",
     "*admiration-delay:   5",
-    "*num-generations:    5000",
+    "*length:             5000",
     "*cell-size:          2",
     "*color-index:        -1",
     "*population-density: 50",
     "*cell-size:          2",
     "*color-index:        -1",
     "*population-density: 50",
@@ -520,14 +520,14 @@ static const char * WolframAutomata_defaults[] = {
 static XrmOptionDescRec WolframAutomata_options[] = {
     { "-delay-usec",         ".delay-usec",             XrmoptionSepArg, 0      },
     { "-admiration-delay",   ".admiration-delay",       XrmoptionSepArg, 0      },
 static XrmOptionDescRec WolframAutomata_options[] = {
     { "-delay-usec",         ".delay-usec",             XrmoptionSepArg, 0      },
     { "-admiration-delay",   ".admiration-delay",       XrmoptionSepArg, 0      },
-    { "-num-generations",    ".num-generations",        XrmoptionSepArg, 0      },
+    { "-length",             ".length",                 XrmoptionSepArg, 0      },
     { "-cell-size",          ".cell-size",              XrmoptionSepArg, 0      },
     { "-color-index",        ".color-index",            XrmoptionSepArg, 0      },
     { "-population-density", ".population-density",     XrmoptionSepArg, 0      },
     { "-population-single",  ".population-single",      XrmoptionNoArg,  "True" },
     { "-random-cell-size",   ".random-cell-size",       XrmoptionNoArg,  "True" },
     { "-random-delay",       ".random-delay",           XrmoptionNoArg,  "True" },
     { "-cell-size",          ".cell-size",              XrmoptionSepArg, 0      },
     { "-color-index",        ".color-index",            XrmoptionSepArg, 0      },
     { "-population-density", ".population-density",     XrmoptionSepArg, 0      },
     { "-population-single",  ".population-single",      XrmoptionNoArg,  "True" },
     { "-random-cell-size",   ".random-cell-size",       XrmoptionNoArg,  "True" },
     { "-random-delay",       ".random-delay",           XrmoptionNoArg,  "True" },
-    { "-random-length",      ".random-num-generations", XrmoptionNoArg,  "True" },
+    { "-random-length",      ".random-length",          XrmoptionNoArg,  "True" },
     { "-random-rule",        ".rule-random",            XrmoptionNoArg,  "True" },
     { "-rule",               ".rule-requested",         XrmoptionSepArg, 0      },
     { 0, 0, 0, 0 }
     { "-random-rule",        ".rule-random",            XrmoptionNoArg,  "True" },
     { "-rule",               ".rule-requested",         XrmoptionSepArg, 0      },
     { 0, 0, 0, 0 }