1 // This file is part of Golly.
2 // See docs/License.html for the copyright notice.
3 
4 #include "jvnalgo.h"
5 
6 // for case-insensitive string comparison
7 #include <cstring>
8 #ifndef WIN32
9    #define stricmp strcasecmp
10 #endif
11 #include <string>
12 
13 using namespace std ;
14 
15 // this algorithm supports three rules:
16 const char* RULE_STRINGS[] = { "JvN29", "Nobili32", "Hutton32" };
17 const int N_STATES[] = { 29, 32, 32 };
18 
NumCellStates()19 int jvnalgo::NumCellStates() {
20    return N_STATES[current_rule];
21 }
22 
setrule(const char * s)23 const char* jvnalgo::setrule(const char *s)
24 {
25    const char* colonptr = strchr(s,':');
26    string rule_name(s);
27    if(colonptr)
28       rule_name.assign(s,colonptr);
29 
30    // check the requested string against the named rules, and deprecated versions
31    if (stricmp(rule_name.c_str(), RULE_STRINGS[JvN29]) == 0 ||
32         stricmp(rule_name.c_str(), "JvN-29") == 0)
33       current_rule = JvN29;
34    else if (stricmp(rule_name.c_str(), RULE_STRINGS[Nobili32]) == 0 ||
35         stricmp(rule_name.c_str(), "JvN-32") == 0)
36       current_rule = Nobili32;
37    else if (stricmp(rule_name.c_str(), RULE_STRINGS[Hutton32]) == 0 ||
38         stricmp(rule_name.c_str(), "modJvN-32") == 0)
39       current_rule = Hutton32;
40    else {
41       return "This algorithm only supports these rules:\nJvN29, Nobili32, Hutton32.";
42    }
43 
44    // check for rule suffix like ":T200,100" to specify a bounded universe
45    if (colonptr) {
46       const char* err = setgridsize(colonptr);
47       if (err) return err;
48    } else {
49       // universe is unbounded
50       gridwd = 0;
51       gridht = 0;
52    }
53 
54    maxCellStates = N_STATES[current_rule];
55    ghashbase::setrule(RULE_STRINGS[current_rule]);
56    return NULL;
57 }
58 
getrule()59 const char* jvnalgo::getrule() {
60    // return canonical rule string
61    static char canonrule[MAXRULESIZE];
62    sprintf(canonrule, "%s", RULE_STRINGS[current_rule]);
63    if (gridwd > 0 || gridht > 0) {
64       // setgridsize() was successfully called above, so append suffix
65       int len = (int)strlen(canonrule);
66       const char* bounds = canonicalsuffix();
67       int i = 0;
68       while (bounds[i]) canonrule[len++] = bounds[i++];
69       canonrule[len] = 0;
70    }
71    return canonrule;
72 }
73 
DefaultRule()74 const char* jvnalgo::DefaultRule() {
75    return RULE_STRINGS[JvN29];
76 }
77 
78 const int NORTH = 1 ;
79 const int SOUTH = 3 ;
80 const int EAST = 0 ;
81 const int WEST = 2 ;
82 const int FLIPDIR = 2 ;
83 const int DIRMASK = 3 ;
84 const int CONF = 0x10 ;
85 const int OTRANS = 0x20 ;
86 const int STRANS = 0x40 ;
87 const int TEXC = 0x80 ;
88 const int CDEXC = 0x80 ;
89 const int CROSSEXC = 6 ;
90 const int CEXC = 1 ;
91 const int BIT_ONEXC = 1 ;
92 const int BIT_OEXC_EW = 2 ;
93 const int BIT_OEXC_NS = 4 ;
94 const int BIT_OEXC = BIT_OEXC_NS | BIT_OEXC_EW ;
95 const int BIT_SEXC = 8 ;
96 const int BIT_CEXC = 16 ;
97 const int BIT_NS_IN = 32 ;
98 const int BIT_EW_IN = 64 ;
99 const int BIT_NS_OUT = 128 ;
100 const int BIT_EW_OUT = 256 ;
101 const int BIT_CROSS = (BIT_NS_IN | BIT_EW_IN | BIT_NS_OUT | BIT_EW_OUT) ;
102 const int BIT_ANY_OUT = (BIT_NS_OUT | BIT_EW_OUT) ;
103 const int BIT_OEXC_OTHER = 512 ;
104 const int BIT_SEXC_OTHER = 1024 ;
105 static state compress[256] ;
106 
107 /**
108  *   These are the legal *internal* states.
109  */
110 static state uncompress[] = {
111    0,                      /* dead */
112    1, 2, 3, 4, 5, 6, 7, 8, /* construction states */
113    32, 33, 34, 35,         /* ordinary */
114    160, 161, 162, 163,     /* ordinary active */
115    64, 65, 66, 67,         /* special */
116    192, 193, 194, 195,     /* special active */
117    16, 144,                /* confluent states */
118    17, 145,                /* more confluent states */
119    146, 148, 150           /* crossing confluent states */
120 } ;
121 
122 /**
123  *   The behavior of the confluent states under the extended
124  *   rules was verified empirically by the wjvn executable,
125  *   because I could not interpret the paper sufficiently to
126  *   cover some cases I thought were ambiguous, or where the
127  *   simulator seemed to contradict the transition rules in the
128  *   paper.   -tgr
129  */
bits(state mcode,state code,state dir)130 static int bits(state mcode, state code, state dir) {
131    if ((code & (TEXC | OTRANS | STRANS | CONF | CEXC)) == 0)
132       return 0 ;
133    if (code & CONF) {
134       if ((mcode & (OTRANS | STRANS)) && ((mcode & DIRMASK) ^ FLIPDIR) == dir)
135          return 0 ;
136       if ((code & 2) && !(dir & 1))
137          return BIT_CEXC ;
138       if ((code & 4) && (dir & 1))
139          return BIT_CEXC ;
140       if (code & 1)
141          return BIT_CEXC ;
142       return 0 ;
143    }
144    if ((code & (OTRANS | STRANS)) == 0)
145       return 0 ;
146    int r = 0 ;
147    if ((code & DIRMASK) == dir) {
148       if (code & OTRANS) {
149          if (dir & 1) {
150            r |= BIT_NS_IN ;
151            if (code & TEXC)
152              r |= BIT_OEXC_NS ;
153            else
154              r |= BIT_ONEXC ;
155          } else {
156            r |= BIT_EW_IN ;
157            if (code & TEXC)
158              r |= BIT_OEXC_EW ;
159            else
160              r |= BIT_ONEXC ;
161          }
162       } else if ((code & (STRANS | TEXC)) == (STRANS | TEXC))
163          r |= BIT_SEXC ;
164       if ((mcode & (OTRANS | STRANS)) && (dir ^ (mcode & DIRMASK)) == 2) {
165          // don't permit these bits to propogate; head to head
166       } else {
167         if (r & BIT_OEXC)
168            r |= BIT_OEXC_OTHER ;
169         if (r & BIT_SEXC)
170            r |= BIT_SEXC_OTHER ;
171       }
172    } else {
173       if (dir & 1)
174          r |= BIT_NS_OUT ;
175       else
176          r |= BIT_EW_OUT ;
177    }
178    return r ;
179 }
180 
181 static state cres[] = {0x22, 0x23, 0x40, 0x41, 0x42, 0x43, 0x10, 0x20, 0x21} ;
182 
jvnalgo()183 jvnalgo::jvnalgo() {
184   for (int i=0; i<256; i++)
185     compress[i] = 255 ;
186   for (unsigned int i=0; i<sizeof(uncompress)/sizeof(uncompress[0]); i++)
187      compress[uncompress[i]] = (state)i ;
188   current_rule = JvN29 ;
189   maxCellStates = N_STATES[current_rule] ;
190 }
191 
~jvnalgo()192 jvnalgo::~jvnalgo() {
193 }
194 
195 state slowcalc_Hutton32(state c,state n,state s,state e,state w);
196 
197 // --- the update function ---
slowcalc(state,state n,state,state w,state c,state e,state,state s,state)198 state jvnalgo::slowcalc(state, state n, state, state w, state c, state e,
199                         state, state s, state) {
200    if(current_rule == JvN29 || current_rule == Nobili32)
201    {
202 	   c = uncompress[c] ;
203 	   int mbits = bits(c, uncompress[n], SOUTH) |
204 	     bits(c, uncompress[w], EAST) |
205 	     bits(c, uncompress[e], WEST) |
206 	     bits(c, uncompress[s], NORTH) ;
207 	   if (c < CONF) {
208 	      if (mbits & (BIT_OEXC | BIT_SEXC))
209 		 c = 2 * c + 1 ;
210 	      else
211 		 c = 2 * c ;
212 	      if (c > 8)
213 		 c = cres[c-9] ;
214 	   } else if (c & CONF) {
215 	      if (mbits & BIT_SEXC)
216 		 c = 0 ;
217 	      else if (current_rule == Nobili32 && (mbits & BIT_CROSS) == BIT_CROSS) {
218 		 if (mbits & BIT_OEXC)
219 		    c = (state)((mbits & BIT_OEXC) + CONF + 0x80) ;
220 		 else
221 		    c = CONF ;
222 	      } else {
223 		 if (c & CROSSEXC) {// was a cross, is no more
224 		    c = (c & ~(CROSSEXC | CDEXC)) ;
225 		 }
226 		 if ((mbits & BIT_OEXC) && !(mbits & BIT_ONEXC))
227 		    c = ((c & CDEXC) >> 7) + (CDEXC | CONF) ;
228 		 else if ((mbits & BIT_ANY_OUT) || current_rule == JvN29)
229 		    c = ((c & CDEXC) >> 7) + CONF ;
230 		 else
231 		    /* no change */ ;
232 	      }
233 	   } else {
234 	      if (((c & OTRANS) && (mbits & BIT_SEXC)) ||
235 		  ((c & STRANS) && (mbits & BIT_OEXC)))
236 		 c = 0 ;
237 	      else if (mbits & (BIT_SEXC_OTHER | BIT_OEXC_OTHER | BIT_CEXC))
238 		 c |= 128 ;
239 	      else
240 		 c &= 127 ;
241 	   }
242 	   return compress[c] ;
243    }
244    else // Hutton32
245    	return slowcalc_Hutton32(c,n,s,e,w);
246 }
247 
248 // XPM data for the 31 7x7 icons used in JvN algo
249 static const char* jvn7x7[] = {
250 // width height ncolors chars_per_pixel
251 "7 217 4 1",
252 // colors
253 ". c #000000",    // black will be transparent
254 "D c #404040",
255 "E c #E0E0E0",
256 "W c #FFFFFF",    // white
257 // pixels
258 ".DEWED.",
259 "DWWWWWD",
260 "EWWWWWE",
261 "WWWWWWW",
262 "EWWWWWE",
263 "DWWWWWD",
264 ".DEWED.",
265 
266 "..WWW..",
267 ".WWWWW.",
268 "WWWWWWW",
269 ".......",
270 "WWW.WWW",
271 ".WW.WW.",
272 "..W.W..",
273 
274 "..W.W..",
275 ".WW.WW.",
276 "WWW.WWW",
277 ".......",
278 "WWWWWWW",
279 ".WWWWW.",
280 "..WWW..",
281 
282 "..W.W..",
283 ".WW.WW.",
284 "WWW.WWW",
285 ".......",
286 "WWW.WWW",
287 "WWW.WWW",
288 "WWW.WWW",
289 
290 "..W.WWW",
291 ".WW.WWW",
292 "WWW.WWW",
293 ".......",
294 "WWW.WWW",
295 "WWW.WW.",
296 "WWW.W..",
297 
298 "WWW.W..",
299 "WWW.WW.",
300 "WWW.WWW",
301 ".......",
302 "WWW.WWW",
303 ".WW.WWW",
304 "..W.WWW",
305 
306 "WWW.WWW",
307 "WWW.WWW",
308 "WWW.WWW",
309 ".......",
310 "WWW.WWW",
311 ".WW.WW.",
312 "..W.W..",
313 
314 "..W.W..",
315 ".WW.WW.",
316 "WWW.WWW",
317 ".......",
318 "WWW.WWW",
319 ".WW.WW.",
320 "..W.W..",
321 
322 ".......",
323 "....W..",
324 "....WW.",
325 "WWWWWWW",
326 "....WW.",
327 "....W..",
328 ".......",
329 
330 "...W...",
331 "..WWW..",
332 ".WWWWW.",
333 "...W...",
334 "...W...",
335 "...W...",
336 "...W...",
337 
338 ".......",
339 "..W....",
340 ".WW....",
341 "WWWWWWW",
342 ".WW....",
343 "..W....",
344 ".......",
345 
346 "...W...",
347 "...W...",
348 "...W...",
349 "...W...",
350 ".WWWWW.",
351 "..WWW..",
352 "...W...",
353 
354 ".......",
355 "....W..",
356 "....WW.",
357 "WWWWWWW",
358 "....WW.",
359 "....W..",
360 ".......",
361 
362 "...W...",
363 "..WWW..",
364 ".WWWWW.",
365 "...W...",
366 "...W...",
367 "...W...",
368 "...W...",
369 
370 ".......",
371 "..W....",
372 ".WW....",
373 "WWWWWWW",
374 ".WW....",
375 "..W....",
376 ".......",
377 
378 "...W...",
379 "...W...",
380 "...W...",
381 "...W...",
382 ".WWWWW.",
383 "..WWW..",
384 "...W...",
385 
386 ".......",
387 "....W..",
388 "....WW.",
389 "WWWWWWW",
390 "....WW.",
391 "....W..",
392 ".......",
393 
394 "...W...",
395 "..WWW..",
396 ".WWWWW.",
397 "...W...",
398 "...W...",
399 "...W...",
400 "...W...",
401 
402 ".......",
403 "..W....",
404 ".WW....",
405 "WWWWWWW",
406 ".WW....",
407 "..W....",
408 ".......",
409 
410 "...W...",
411 "...W...",
412 "...W...",
413 "...W...",
414 ".WWWWW.",
415 "..WWW..",
416 "...W...",
417 
418 ".......",
419 "....W..",
420 "....WW.",
421 "WWWWWWW",
422 "....WW.",
423 "....W..",
424 ".......",
425 
426 "...W...",
427 "..WWW..",
428 ".WWWWW.",
429 "...W...",
430 "...W...",
431 "...W...",
432 "...W...",
433 
434 ".......",
435 "..W....",
436 ".WW....",
437 "WWWWWWW",
438 ".WW....",
439 "..W....",
440 ".......",
441 
442 "...W...",
443 "...W...",
444 "...W...",
445 "...W...",
446 ".WWWWW.",
447 "..WWW..",
448 "...W...",
449 
450 "...W...",
451 "..WWW..",
452 ".WW.WW.",
453 "WW...WW",
454 ".WW.WW.",
455 "..WWW..",
456 "...W...",
457 
458 "...W...",
459 "..WWW..",
460 ".WW.WW.",
461 "WW...WW",
462 ".WW.WW.",
463 "..WWW..",
464 "...W...",
465 
466 "...W...",
467 "..WWW..",
468 ".WWWWW.",
469 "WWW.WWW",
470 ".WWWWW.",
471 "..WWW..",
472 "...W...",
473 
474 "...W...",
475 "..WWW..",
476 ".WWWWW.",
477 "WWWWWWW",
478 ".WWWWW.",
479 "..WWW..",
480 "...W...",
481 
482 "...W...",
483 "..W.W..",
484 ".WW.WW.",
485 "WWW.WWW",
486 ".WW.WW.",
487 "..W.W..",
488 "...W...",
489 
490 "...W...",
491 "..WWW..",
492 ".WWWWW.",
493 "W.....W",
494 ".WWWWW.",
495 "..WWW..",
496 "...W...",
497 
498 "...W...",
499 "..WWW..",
500 ".W.W.W.",
501 "WWW.WWW",
502 ".W.W.W.",
503 "..WWW..",
504 "...W..."};
505 
506 // XPM data for the 31 15x15 icons used in JvN algo
507 static const char* jvn15x15[] = {
508 // width height ncolors chars_per_pixel
509 "15 465 5 1",
510 // colors
511 ". c #000000",    // black will be transparent
512 "D c #404040",
513 "C c #808080",
514 "B c #C0C0C0",
515 "W c #FFFFFF",    // white
516 // pixels
517 "...............",
518 "....DBWWWBD....",
519 "...BWWWWWWWB...",
520 "..BWWWWWWWWWB..",
521 ".DWWWWWWWWWWWD.",
522 ".BWWWWWWWWWWWB.",
523 ".WWWWWWWWWWWWW.",
524 ".WWWWWWWWWWWWW.",
525 ".WWWWWWWWWWWWW.",
526 ".BWWWWWWWWWWWB.",
527 ".DWWWWWWWWWWWD.",
528 "..BWWWWWWWWWB..",
529 "...BWWWWWWWB...",
530 "....DBWWWBD....",
531 "...............",
532 
533 "...............",
534 "......WWW......",
535 ".....WWWWW.....",
536 "....WWWWWWW....",
537 "...WWWWWWWWW...",
538 "..WWWWWWWWWWW..",
539 ".WWWWWWWWWWWWW.",
540 "...............",
541 ".WWWWWW.WWWWWW.",
542 "..WWWWW.WWWWW..",
543 "...WWWW.WWWW...",
544 "....WWW.WWW....",
545 ".....WW.WW.....",
546 "......W.W......",
547 "...............",
548 
549 "...............",
550 "......W.W......",
551 ".....WW.WW.....",
552 "....WWW.WWW....",
553 "...WWWW.WWWW...",
554 "..WWWWW.WWWWW..",
555 ".WWWWWW.WWWWWW.",
556 "...............",
557 ".WWWWWWWWWWWWW.",
558 "..WWWWWWWWWWW..",
559 "...WWWWWWWWW...",
560 "....WWWWWWW....",
561 ".....WWWWW.....",
562 "......WWW......",
563 "...............",
564 
565 "...............",
566 "......W.W......",
567 ".....WW.WW.....",
568 "....WWW.WWW....",
569 "...WWWW.WWWW...",
570 "..WWWWW.WWWWW..",
571 ".WWWWWW.WWWWWW.",
572 "...............",
573 ".WWWWWW.WWWWWW.",
574 ".WWWWWW.WWWWWW.",
575 ".WWWWWW.WWWWWW.",
576 ".WWWWWW.WWWWWW.",
577 ".WWWWWW.WWWWWW.",
578 ".WWWWWW.WWWWWW.",
579 "...............",
580 
581 "...............",
582 "......W.WWWWWW.",
583 ".....WW.WWWWWW.",
584 "....WWW.WWWWWW.",
585 "...WWWW.WWWWWW.",
586 "..WWWWW.WWWWWW.",
587 ".WWWWWW.WWWWWW.",
588 "...............",
589 ".WWWWWW.WWWWWW.",
590 ".WWWWWW.WWWWW..",
591 ".WWWWWW.WWWW...",
592 ".WWWWWW.WWW....",
593 ".WWWWWW.WW.....",
594 ".WWWWWW.W......",
595 "...............",
596 
597 "...............",
598 ".WWWWWW.W......",
599 ".WWWWWW.WW.....",
600 ".WWWWWW.WWW....",
601 ".WWWWWW.WWWW...",
602 ".WWWWWW.WWWWW..",
603 ".WWWWWW.WWWWWW.",
604 "...............",
605 ".WWWWWW.WWWWWW.",
606 "..WWWWW.WWWWWW.",
607 "...WWWW.WWWWWW.",
608 "....WWW.WWWWWW.",
609 ".....WW.WWWWWW.",
610 "......W.WWWWWW.",
611 "...............",
612 
613 "...............",
614 ".WWWWWW.WWWWWW.",
615 ".WWWWWW.WWWWWW.",
616 ".WWWWWW.WWWWWW.",
617 ".WWWWWW.WWWWWW.",
618 ".WWWWWW.WWWWWW.",
619 ".WWWWWW.WWWWWW.",
620 "...............",
621 ".WWWWWW.WWWWWW.",
622 "..WWWWW.WWWWW..",
623 "...WWWW.WWWW...",
624 "....WWW.WWW....",
625 ".....WW.WW.....",
626 "......W.W......",
627 "...............",
628 
629 "...............",
630 "......W.W......",
631 ".....WW.WW.....",
632 "....WWW.WWW....",
633 "...WWWW.WWWW...",
634 "..WWWWW.WWWWW..",
635 ".WWWWWW.WWWWWW.",
636 "...............",
637 ".WWWWWW.WWWWWW.",
638 "..WWWWW.WWWWW..",
639 "...WWWW.WWWW...",
640 "....WWW.WWW....",
641 ".....WW.WW.....",
642 "......W.W......",
643 "...............",
644 
645 "...............",
646 ".......W.......",
647 ".......WW......",
648 ".......WWW.....",
649 ".......WWWW....",
650 ".......WWWWW...",
651 ".WWWWWWWWWWWW..",
652 ".WWWWWWWWWWWWW.",
653 ".WWWWWWWWWWWW..",
654 ".......WWWWW...",
655 ".......WWWW....",
656 ".......WWW.....",
657 ".......WW......",
658 ".......W.......",
659 "...............",
660 
661 "...............",
662 ".......W.......",
663 "......WWW......",
664 ".....WWWWW.....",
665 "....WWWWWWW....",
666 "...WWWWWWWWW...",
667 "..WWWWWWWWWWW..",
668 ".WWWWWWWWWWWWW.",
669 "......WWW......",
670 "......WWW......",
671 "......WWW......",
672 "......WWW......",
673 "......WWW......",
674 "......WWW......",
675 
676 "...............",
677 "...............",
678 ".......W.......",
679 "......WW.......",
680 ".....WWW.......",
681 "....WWWW.......",
682 "...WWWWW.......",
683 "..WWWWWWWWWWWW.",
684 ".WWWWWWWWWWWWW.",
685 "..WWWWWWWWWWWW.",
686 "...WWWWW.......",
687 "....WWWW.......",
688 ".....WWW.......",
689 "......WW.......",
690 ".......W.......",
691 "...............",
692 
693 "...............",
694 "......WWW......",
695 "......WWW......",
696 "......WWW......",
697 "......WWW......",
698 "......WWW......",
699 "......WWW......",
700 ".WWWWWWWWWWWWW.",
701 "..WWWWWWWWWWW..",
702 "...WWWWWWWWW...",
703 "....WWWWWWW....",
704 ".....WWWWW.....",
705 "......WWW......",
706 ".......W.......",
707 "...............",
708 
709 "...............",
710 ".......W.......",
711 ".......WW......",
712 ".......WWW.....",
713 ".......WWWW....",
714 ".......WWWWW...",
715 ".WWWWWWWWWWWW..",
716 ".WWWWWWWWWWWWW.",
717 ".WWWWWWWWWWWW..",
718 ".......WWWWW...",
719 ".......WWWW....",
720 ".......WWW.....",
721 ".......WW......",
722 ".......W.......",
723 "...............",
724 
725 "...............",
726 ".......W.......",
727 "......WWW......",
728 ".....WWWWW.....",
729 "....WWWWWWW....",
730 "...WWWWWWWWW...",
731 "..WWWWWWWWWWW..",
732 ".WWWWWWWWWWWWW.",
733 "......WWW......",
734 "......WWW......",
735 "......WWW......",
736 "......WWW......",
737 "......WWW......",
738 "......WWW......",
739 "...............",
740 
741 "...............",
742 ".......W.......",
743 "......WW.......",
744 ".....WWW.......",
745 "....WWWW.......",
746 "...WWWWW.......",
747 "..WWWWWWWWWWWW.",
748 ".WWWWWWWWWWWWW.",
749 "..WWWWWWWWWWWW.",
750 "...WWWWW.......",
751 "....WWWW.......",
752 ".....WWW.......",
753 "......WW.......",
754 ".......W.......",
755 "...............",
756 
757 "...............",
758 "......WWW......",
759 "......WWW......",
760 "......WWW......",
761 "......WWW......",
762 "......WWW......",
763 "......WWW......",
764 ".WWWWWWWWWWWWW.",
765 "..WWWWWWWWWWW..",
766 "...WWWWWWWWW...",
767 "....WWWWWWW....",
768 ".....WWWWW.....",
769 "......WWW......",
770 ".......W.......",
771 "...............",
772 
773 "...............",
774 ".......W.......",
775 ".......WW......",
776 ".......WWW.....",
777 ".......WWWW....",
778 ".......WWWWW...",
779 ".WWWWWWWWWWWW..",
780 ".WWWWWWWWWWWWW.",
781 ".WWWWWWWWWWWW..",
782 ".......WWWWW...",
783 ".......WWWW....",
784 ".......WWW.....",
785 ".......WW......",
786 ".......W.......",
787 "...............",
788 
789 "...............",
790 ".......W.......",
791 "......WWW......",
792 ".....WWWWW.....",
793 "....WWWWWWW....",
794 "...WWWWWWWWW...",
795 "..WWWWWWWWWWW..",
796 ".WWWWWWWWWWWWW.",
797 "......WWW......",
798 "......WWW......",
799 "......WWW......",
800 "......WWW......",
801 "......WWW......",
802 "......WWW......",
803 "...............",
804 
805 "...............",
806 ".......W.......",
807 "......WW.......",
808 ".....WWW.......",
809 "....WWWW.......",
810 "...WWWWW.......",
811 "..WWWWWWWWWWWW.",
812 ".WWWWWWWWWWWWW.",
813 "..WWWWWWWWWWWW.",
814 "...WWWWW.......",
815 "....WWWW.......",
816 ".....WWW.......",
817 "......WW.......",
818 ".......W.......",
819 "...............",
820 
821 "...............",
822 "......WWW......",
823 "......WWW......",
824 "......WWW......",
825 "......WWW......",
826 "......WWW......",
827 "......WWW......",
828 ".WWWWWWWWWWWWW.",
829 "..WWWWWWWWWWW..",
830 "...WWWWWWWWW...",
831 "....WWWWWWW....",
832 ".....WWWWW.....",
833 "......WWW......",
834 ".......W.......",
835 "...............",
836 
837 "...............",
838 ".......W.......",
839 ".......WW......",
840 ".......WWW.....",
841 ".......WWWW....",
842 ".......WWWWW...",
843 ".WWWWWWWWWWWW..",
844 ".WWWWWWWWWWWWW.",
845 ".WWWWWWWWWWWW..",
846 ".......WWWWW...",
847 ".......WWWW....",
848 ".......WWW.....",
849 ".......WW......",
850 ".......W.......",
851 "...............",
852 
853 "...............",
854 ".......W.......",
855 "......WWW......",
856 ".....WWWWW.....",
857 "....WWWWWWW....",
858 "...WWWWWWWWW...",
859 "..WWWWWWWWWWW..",
860 ".WWWWWWWWWWWWW.",
861 "......WWW......",
862 "......WWW......",
863 "......WWW......",
864 "......WWW......",
865 "......WWW......",
866 "......WWW......",
867 "...............",
868 
869 "...............",
870 ".......W.......",
871 "......WW.......",
872 ".....WWW.......",
873 "....WWWW.......",
874 "...WWWWW.......",
875 "..WWWWWWWWWWWW.",
876 ".WWWWWWWWWWWWW.",
877 "..WWWWWWWWWWWW.",
878 "...WWWWW.......",
879 "....WWWW.......",
880 ".....WWW.......",
881 "......WW.......",
882 ".......W.......",
883 "...............",
884 
885 "...............",
886 "......WWW......",
887 "......WWW......",
888 "......WWW......",
889 "......WWW......",
890 "......WWW......",
891 "......WWW......",
892 ".WWWWWWWWWWWWW.",
893 "..WWWWWWWWWWW..",
894 "...WWWWWWWWW...",
895 "....WWWWWWW....",
896 ".....WWWWW.....",
897 "......WWW......",
898 ".......W.......",
899 "...............",
900 
901 "...............",
902 ".......W.......",
903 "......WWW......",
904 ".....WWWWW.....",
905 "....WWWWWWW....",
906 "...WWWW.WWWW...",
907 "..WWWW...WWWW..",
908 ".WWWW.....WWWW.",
909 "..WWWW...WWWW..",
910 "...WWWW.WWWW...",
911 "....WWWWWWW....",
912 ".....WWWWW.....",
913 "......WWW......",
914 ".......W.......",
915 "...............",
916 
917 "...............",
918 ".......W.......",
919 "......WWW......",
920 ".....WWWWW.....",
921 "....WWWWWWW....",
922 "...WWWW.WWWW...",
923 "..WWWW...WWWW..",
924 ".WWWW.....WWWW.",
925 "..WWWW...WWWW..",
926 "...WWWW.WWWW...",
927 "....WWWWWWW....",
928 ".....WWWWW.....",
929 "......WWW......",
930 ".......W.......",
931 "...............",
932 
933 "...............",
934 ".......W.......",
935 "......WWW......",
936 ".....WWWWW.....",
937 "....WWWWWWW....",
938 "...WWWWWWWWW...",
939 "..WWWW...WWWW..",
940 ".WWWWW...WWWWW.",
941 "..WWWW...WWWW..",
942 "...WWWWWWWWW...",
943 "....WWWWWWW....",
944 ".....WWWWW.....",
945 "......WWW......",
946 ".......W.......",
947 "...............",
948 
949 "...............",
950 ".......W.......",
951 "......WWW......",
952 ".....WWWWW.....",
953 "....WWWWWWW....",
954 "...WWWWWWWWW...",
955 "..WWWWWWWWWWW..",
956 ".WWWWWWWWWWWWW.",
957 "..WWWWWWWWWWW..",
958 "...WWWWWWWWW...",
959 "....WWWWWWW....",
960 ".....WWWWW.....",
961 "......WWW......",
962 ".......W.......",
963 "...............",
964 
965 "...............",
966 ".......W.......",
967 "......WWW......",
968 ".....W...W.....",
969 "....WW...WW....",
970 "...WWW...WWW...",
971 "..WWWW...WWWW..",
972 ".WWWWW...WWWWW.",
973 "..WWWW...WWWW..",
974 "...WWW...WWW...",
975 "....WW...WW....",
976 ".....W...W.....",
977 "......WWW......",
978 ".......W.......",
979 "...............",
980 
981 "...............",
982 ".......W.......",
983 "......WWW......",
984 ".....WWWWW.....",
985 "....WWWWWWW....",
986 "...WWWWWWWWW...",
987 "..W.........W..",
988 ".WW.........WW.",
989 "..W.........W..",
990 "...WWWWWWWWW...",
991 "....WWWWWWW....",
992 ".....WWWWW.....",
993 "......WWW......",
994 ".......W.......",
995 "...............",
996 
997 "...............",
998 ".......W.......",
999 "......WWW......",
1000 ".....WWWWW.....",
1001 "....W.WWW.W....",
1002 "...W...W...W...",
1003 "..WWW.....WWW..",
1004 ".WWWWW...WWWWW.",
1005 "..WWW.....WWW..",
1006 "...W...W...W...",
1007 "....W.WWW.W....",
1008 ".....WWWWW.....",
1009 "......WWW......",
1010 ".......W.......",
1011 "..............."};
1012 
1013 // XPM data for the 31 31x31 icons used in JvN algo
1014 static const char* jvn31x31[] = {
1015 // width height ncolors chars_per_pixel
1016 "31 961 5 1",
1017 // colors
1018 ". c #000000",    // black will be transparent
1019 "D c #404040",
1020 "C c #808080",
1021 "B c #C0C0C0",
1022 "W c #FFFFFF",    // white
1023 // pixels
1024 "...............................",
1025 "...............................",
1026 "..........DCBWWWWWBCD..........",
1027 ".........CWWWWWWWWWWWC.........",
1028 ".......DWWWWWWWWWWWWWWWD.......",
1029 "......BWWWWWWWWWWWWWWWWWB......",
1030 ".....BWWWWWWWWWWWWWWWWWWWB.....",
1031 "....DWWWWWWWWWWWWWWWWWWWWWD....",
1032 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1033 "...CWWWWWWWWWWWWWWWWWWWWWWWC...",
1034 "..DWWWWWWWWWWWWWWWWWWWWWWWWWD..",
1035 "..CWWWWWWWWWWWWWWWWWWWWWWWWWC..",
1036 "..BWWWWWWWWWWWWWWWWWWWWWWWWWB..",
1037 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1038 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1039 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1040 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1041 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1042 "..BWWWWWWWWWWWWWWWWWWWWWWWWWB..",
1043 "..CWWWWWWWWWWWWWWWWWWWWWWWWWC..",
1044 "..DWWWWWWWWWWWWWWWWWWWWWWWWWD..",
1045 "...CWWWWWWWWWWWWWWWWWWWWWWWC...",
1046 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1047 "....DWWWWWWWWWWWWWWWWWWWWWD....",
1048 ".....BWWWWWWWWWWWWWWWWWWWB.....",
1049 "......BWWWWWWWWWWWWWWWWWB......",
1050 ".......DWWWWWWWWWWWWWWWD.......",
1051 ".........CWWWWWWWWWWWC.........",
1052 "..........DCBWWWWWBCD..........",
1053 "...............................",
1054 "...............................",
1055 
1056 "...............................",
1057 "...............W...............",
1058 "..............WWW..............",
1059 ".............WWWWW.............",
1060 "............WWWWWWW............",
1061 "...........WWWWWWWWW...........",
1062 "..........WWWWWWWWWWW..........",
1063 ".........WWWWWWWWWWWWW.........",
1064 "........WWWWWWWWWWWWWWW........",
1065 ".......WWWWWWWWWWWWWWWWW.......",
1066 "......WWWWWWWWWWWWWWWWWWW......",
1067 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1068 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1069 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1070 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1071 "...............................",
1072 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1073 "...WWWWWWWWWWWW.WWWWWWWWWWWW...",
1074 "....WWWWWWWWWWW.WWWWWWWWWWW....",
1075 ".....WWWWWWWWWW.WWWWWWWWWW.....",
1076 "......WWWWWWWWW.WWWWWWWWW......",
1077 ".......WWWWWWWW.WWWWWWWW.......",
1078 "........WWWWWWW.WWWWWWW........",
1079 ".........WWWWWW.WWWWWW.........",
1080 "..........WWWWW.WWWWW..........",
1081 "...........WWWW.WWWW...........",
1082 "............WWW.WWW............",
1083 ".............WW.WW.............",
1084 "..............W.W..............",
1085 "...............................",
1086 "...............................",
1087 
1088 "...............................",
1089 "...............................",
1090 "..............W.W..............",
1091 ".............WW.WW.............",
1092 "............WWW.WWW............",
1093 "...........WWWW.WWWW...........",
1094 "..........WWWWW.WWWWW..........",
1095 ".........WWWWWW.WWWWWW.........",
1096 "........WWWWWWW.WWWWWWW........",
1097 ".......WWWWWWWW.WWWWWWWW.......",
1098 "......WWWWWWWWW.WWWWWWWWW......",
1099 ".....WWWWWWWWWW.WWWWWWWWWW.....",
1100 "....WWWWWWWWWWW.WWWWWWWWWWW....",
1101 "...WWWWWWWWWWWW.WWWWWWWWWWWW...",
1102 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1103 "...............................",
1104 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1105 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1106 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1107 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1108 "......WWWWWWWWWWWWWWWWWWW......",
1109 ".......WWWWWWWWWWWWWWWWW.......",
1110 "........WWWWWWWWWWWWWWW........",
1111 ".........WWWWWWWWWWWWW.........",
1112 "..........WWWWWWWWWWW..........",
1113 "...........WWWWWWWWW...........",
1114 "............WWWWWWW............",
1115 ".............WWWWW.............",
1116 "..............WWW..............",
1117 "...............W...............",
1118 "...............................",
1119 
1120 "...............................",
1121 "...............................",
1122 "..............W.W..............",
1123 ".............WW.WW.............",
1124 "............WWW.WWW............",
1125 "...........WWWW.WWWW...........",
1126 "..........WWWWW.WWWWW..........",
1127 ".........WWWWWW.WWWWWW.........",
1128 "........WWWWWWW.WWWWWWW........",
1129 ".......WWWWWWWW.WWWWWWWW.......",
1130 "......WWWWWWWWW.WWWWWWWWW......",
1131 ".....WWWWWWWWWW.WWWWWWWWWW.....",
1132 "....WWWWWWWWWWW.WWWWWWWWWWW....",
1133 "...WWWWWWWWWWWW.WWWWWWWWWWWW...",
1134 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1135 "...............................",
1136 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1137 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1138 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1139 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1140 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1141 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1142 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1143 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1144 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1145 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1146 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1147 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1148 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1149 "...............................",
1150 "...............................",
1151 
1152 "...............................",
1153 "...............................",
1154 "..............W.WWWWWWWWWWWWW..",
1155 ".............WW.WWWWWWWWWWWWW..",
1156 "............WWW.WWWWWWWWWWWWW..",
1157 "...........WWWW.WWWWWWWWWWWWW..",
1158 "..........WWWWW.WWWWWWWWWWWWW..",
1159 ".........WWWWWW.WWWWWWWWWWWWW..",
1160 "........WWWWWWW.WWWWWWWWWWWWW..",
1161 ".......WWWWWWWW.WWWWWWWWWWWWW..",
1162 "......WWWWWWWWW.WWWWWWWWWWWWW..",
1163 ".....WWWWWWWWWW.WWWWWWWWWWWWW..",
1164 "....WWWWWWWWWWW.WWWWWWWWWWWWW..",
1165 "...WWWWWWWWWWWW.WWWWWWWWWWWWW..",
1166 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1167 "...............................",
1168 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1169 "..WWWWWWWWWWWWW.WWWWWWWWWWWW...",
1170 "..WWWWWWWWWWWWW.WWWWWWWWWWW....",
1171 "..WWWWWWWWWWWWW.WWWWWWWWWW.....",
1172 "..WWWWWWWWWWWWW.WWWWWWWWW......",
1173 "..WWWWWWWWWWWWW.WWWWWWWW.......",
1174 "..WWWWWWWWWWWWW.WWWWWWW........",
1175 "..WWWWWWWWWWWWW.WWWWWW.........",
1176 "..WWWWWWWWWWWWW.WWWWW..........",
1177 "..WWWWWWWWWWWWW.WWWW...........",
1178 "..WWWWWWWWWWWWW.WWW............",
1179 "..WWWWWWWWWWWWW.WW.............",
1180 "..WWWWWWWWWWWWW.W..............",
1181 "...............................",
1182 "...............................",
1183 
1184 "...............................",
1185 "...............................",
1186 "..WWWWWWWWWWWWW.W..............",
1187 "..WWWWWWWWWWWWW.WW.............",
1188 "..WWWWWWWWWWWWW.WWW............",
1189 "..WWWWWWWWWWWWW.WWWW...........",
1190 "..WWWWWWWWWWWWW.WWWWW..........",
1191 "..WWWWWWWWWWWWW.WWWWWW.........",
1192 "..WWWWWWWWWWWWW.WWWWWWW........",
1193 "..WWWWWWWWWWWWW.WWWWWWWW.......",
1194 "..WWWWWWWWWWWWW.WWWWWWWWW......",
1195 "..WWWWWWWWWWWWW.WWWWWWWWWW.....",
1196 "..WWWWWWWWWWWWW.WWWWWWWWWWW....",
1197 "..WWWWWWWWWWWWW.WWWWWWWWWWWW...",
1198 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1199 "...............................",
1200 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1201 "...WWWWWWWWWWWW.WWWWWWWWWWWWW..",
1202 "....WWWWWWWWWWW.WWWWWWWWWWWWW..",
1203 ".....WWWWWWWWWW.WWWWWWWWWWWWW..",
1204 "......WWWWWWWWW.WWWWWWWWWWWWW..",
1205 ".......WWWWWWWW.WWWWWWWWWWWWW..",
1206 "........WWWWWWW.WWWWWWWWWWWWW..",
1207 ".........WWWWWW.WWWWWWWWWWWWW..",
1208 "..........WWWWW.WWWWWWWWWWWWW..",
1209 "...........WWWW.WWWWWWWWWWWWW..",
1210 "............WWW.WWWWWWWWWWWWW..",
1211 ".............WW.WWWWWWWWWWWWW..",
1212 "..............W.WWWWWWWWWWWWW..",
1213 "...............................",
1214 "...............................",
1215 
1216 "...............................",
1217 "...............................",
1218 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1219 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1220 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1221 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1222 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1223 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1224 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1225 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1226 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1227 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1228 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1229 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1230 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1231 "...............................",
1232 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1233 "...WWWWWWWWWWWW.WWWWWWWWWWWW...",
1234 "....WWWWWWWWWWW.WWWWWWWWWWW....",
1235 ".....WWWWWWWWWW.WWWWWWWWWW.....",
1236 "......WWWWWWWWW.WWWWWWWWW......",
1237 ".......WWWWWWWW.WWWWWWWW.......",
1238 "........WWWWWWW.WWWWWWW........",
1239 ".........WWWWWW.WWWWWW.........",
1240 "..........WWWWW.WWWWW..........",
1241 "...........WWWW.WWWW...........",
1242 "............WWW.WWW............",
1243 ".............WW.WW.............",
1244 "..............W.W..............",
1245 "...............................",
1246 "...............................",
1247 
1248 "...............................",
1249 "...............................",
1250 "..............W.W..............",
1251 ".............WW.WW.............",
1252 "............WWW.WWW............",
1253 "...........WWWW.WWWW...........",
1254 "..........WWWWW.WWWWW..........",
1255 ".........WWWWWW.WWWWWW.........",
1256 "........WWWWWWW.WWWWWWW........",
1257 ".......WWWWWWWW.WWWWWWWW.......",
1258 "......WWWWWWWWW.WWWWWWWWW......",
1259 ".....WWWWWWWWWW.WWWWWWWWWW.....",
1260 "....WWWWWWWWWWW.WWWWWWWWWWW....",
1261 "...WWWWWWWWWWWW.WWWWWWWWWWWW...",
1262 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1263 "...............................",
1264 "..WWWWWWWWWWWWW.WWWWWWWWWWWWW..",
1265 "...WWWWWWWWWWWW.WWWWWWWWWWWW...",
1266 "....WWWWWWWWWWW.WWWWWWWWWWW....",
1267 ".....WWWWWWWWWW.WWWWWWWWWW.....",
1268 "......WWWWWWWWW.WWWWWWWWW......",
1269 ".......WWWWWWWW.WWWWWWWW.......",
1270 "........WWWWWWW.WWWWWWW........",
1271 ".........WWWWWW.WWWWWW.........",
1272 "..........WWWWW.WWWWW..........",
1273 "...........WWWW.WWWW...........",
1274 "............WWW.WWW............",
1275 ".............WW.WW.............",
1276 "..............W.W..............",
1277 "...............................",
1278 "...............................",
1279 
1280 "...............................",
1281 "...............................",
1282 "...............W...............",
1283 "...............WW..............",
1284 "...............WWW.............",
1285 "...............WWWW............",
1286 "...............WWWWW...........",
1287 "...............WWWWWW..........",
1288 "...............WWWWWWW.........",
1289 "...............WWWWWWWW........",
1290 "...............WWWWWWWWW.......",
1291 "...............WWWWWWWWWW......",
1292 "...............WWWWWWWWWWW.....",
1293 "..WWWWWWWWWWWWWWWWWWWWWWWWW....",
1294 "..WWWWWWWWWWWWWWWWWWWWWWWWWW...",
1295 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1296 "..WWWWWWWWWWWWWWWWWWWWWWWWWW...",
1297 "..WWWWWWWWWWWWWWWWWWWWWWWWW....",
1298 "...............WWWWWWWWWWW.....",
1299 "...............WWWWWWWWWW......",
1300 "...............WWWWWWWWW.......",
1301 "...............WWWWWWWW........",
1302 "...............WWWWWWW.........",
1303 "...............WWWWWW..........",
1304 "...............WWWWW...........",
1305 "...............WWWW............",
1306 "...............WWW.............",
1307 "...............WW..............",
1308 "...............W...............",
1309 "...............................",
1310 "...............................",
1311 
1312 "...............................",
1313 "...............................",
1314 "...............W...............",
1315 "..............WWW..............",
1316 ".............WWWWW.............",
1317 "............WWWWWWW............",
1318 "...........WWWWWWWWW...........",
1319 "..........WWWWWWWWWWW..........",
1320 ".........WWWWWWWWWWWWW.........",
1321 "........WWWWWWWWWWWWWWW........",
1322 ".......WWWWWWWWWWWWWWWWW.......",
1323 "......WWWWWWWWWWWWWWWWWWW......",
1324 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1325 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1326 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1327 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1328 ".............WWWWW.............",
1329 ".............WWWWW.............",
1330 ".............WWWWW.............",
1331 ".............WWWWW.............",
1332 ".............WWWWW.............",
1333 ".............WWWWW.............",
1334 ".............WWWWW.............",
1335 ".............WWWWW.............",
1336 ".............WWWWW.............",
1337 ".............WWWWW.............",
1338 ".............WWWWW.............",
1339 ".............WWWWW.............",
1340 ".............WWWWW.............",
1341 "...............................",
1342 "...............................",
1343 
1344 "...............................",
1345 "...............................",
1346 "...............W...............",
1347 "..............WW...............",
1348 ".............WWW...............",
1349 "............WWWW...............",
1350 "...........WWWWW...............",
1351 "..........WWWWWW...............",
1352 ".........WWWWWWW...............",
1353 "........WWWWWWWW...............",
1354 ".......WWWWWWWWW...............",
1355 "......WWWWWWWWWW...............",
1356 ".....WWWWWWWWWWW...............",
1357 "....WWWWWWWWWWWWWWWWWWWWWWWWW..",
1358 "...WWWWWWWWWWWWWWWWWWWWWWWWWW..",
1359 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1360 "...WWWWWWWWWWWWWWWWWWWWWWWWWW..",
1361 "....WWWWWWWWWWWWWWWWWWWWWWWWW..",
1362 ".....WWWWWWWWWWW...............",
1363 "......WWWWWWWWWW...............",
1364 ".......WWWWWWWWW...............",
1365 "........WWWWWWWW...............",
1366 ".........WWWWWWW...............",
1367 "..........WWWWWW...............",
1368 "...........WWWWW...............",
1369 "............WWWW...............",
1370 ".............WWW...............",
1371 "..............WW...............",
1372 "...............W...............",
1373 "...............................",
1374 "...............................",
1375 
1376 "...............................",
1377 "...............................",
1378 ".............WWWWW.............",
1379 ".............WWWWW.............",
1380 ".............WWWWW.............",
1381 ".............WWWWW.............",
1382 ".............WWWWW.............",
1383 ".............WWWWW.............",
1384 ".............WWWWW.............",
1385 ".............WWWWW.............",
1386 ".............WWWWW.............",
1387 ".............WWWWW.............",
1388 ".............WWWWW.............",
1389 ".............WWWWW.............",
1390 ".............WWWWW.............",
1391 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1392 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1393 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1394 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1395 "......WWWWWWWWWWWWWWWWWWW......",
1396 ".......WWWWWWWWWWWWWWWWW.......",
1397 "........WWWWWWWWWWWWWWW........",
1398 ".........WWWWWWWWWWWWW.........",
1399 "..........WWWWWWWWWWW..........",
1400 "...........WWWWWWWWW...........",
1401 "............WWWWWWW............",
1402 ".............WWWWW.............",
1403 "..............WWW..............",
1404 "...............W...............",
1405 "...............................",
1406 "...............................",
1407 
1408 "...............................",
1409 "...............................",
1410 "...............W...............",
1411 "...............WW..............",
1412 "...............WWW.............",
1413 "...............WWWW............",
1414 "...............WWWWW...........",
1415 "...............WWWWWW..........",
1416 "...............WWWWWWW.........",
1417 "...............WWWWWWWW........",
1418 "...............WWWWWWWWW.......",
1419 "...............WWWWWWWWWW......",
1420 "...............WWWWWWWWWWW.....",
1421 "..WWWWWWWWWWWWWWWWWWWWWWWWW....",
1422 "..WWWWWWWWWWWWWWWWWWWWWWWWWW...",
1423 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1424 "..WWWWWWWWWWWWWWWWWWWWWWWWWW...",
1425 "..WWWWWWWWWWWWWWWWWWWWWWWWW....",
1426 "...............WWWWWWWWWWW.....",
1427 "...............WWWWWWWWWW......",
1428 "...............WWWWWWWWW.......",
1429 "...............WWWWWWWW........",
1430 "...............WWWWWWW.........",
1431 "...............WWWWWW..........",
1432 "...............WWWWW...........",
1433 "...............WWWW............",
1434 "...............WWW.............",
1435 "...............WW..............",
1436 "...............W...............",
1437 "...............................",
1438 "...............................",
1439 
1440 "...............................",
1441 "...............................",
1442 "...............W...............",
1443 "..............WWW..............",
1444 ".............WWWWW.............",
1445 "............WWWWWWW............",
1446 "...........WWWWWWWWW...........",
1447 "..........WWWWWWWWWWW..........",
1448 ".........WWWWWWWWWWWWW.........",
1449 "........WWWWWWWWWWWWWWW........",
1450 ".......WWWWWWWWWWWWWWWWW.......",
1451 "......WWWWWWWWWWWWWWWWWWW......",
1452 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1453 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1454 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1455 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1456 ".............WWWWW.............",
1457 ".............WWWWW.............",
1458 ".............WWWWW.............",
1459 ".............WWWWW.............",
1460 ".............WWWWW.............",
1461 ".............WWWWW.............",
1462 ".............WWWWW.............",
1463 ".............WWWWW.............",
1464 ".............WWWWW.............",
1465 ".............WWWWW.............",
1466 ".............WWWWW.............",
1467 ".............WWWWW.............",
1468 ".............WWWWW.............",
1469 "...............................",
1470 "...............................",
1471 
1472 "...............................",
1473 "...............................",
1474 "...............W...............",
1475 "..............WW...............",
1476 ".............WWW...............",
1477 "............WWWW...............",
1478 "...........WWWWW...............",
1479 "..........WWWWWW...............",
1480 ".........WWWWWWW...............",
1481 "........WWWWWWWW...............",
1482 ".......WWWWWWWWW...............",
1483 "......WWWWWWWWWW...............",
1484 ".....WWWWWWWWWWW...............",
1485 "....WWWWWWWWWWWWWWWWWWWWWWWWW..",
1486 "...WWWWWWWWWWWWWWWWWWWWWWWWWW..",
1487 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1488 "...WWWWWWWWWWWWWWWWWWWWWWWWWW..",
1489 "....WWWWWWWWWWWWWWWWWWWWWWWWW..",
1490 ".....WWWWWWWWWWW...............",
1491 "......WWWWWWWWWW...............",
1492 ".......WWWWWWWWW...............",
1493 "........WWWWWWWW...............",
1494 ".........WWWWWWW...............",
1495 "..........WWWWWW...............",
1496 "...........WWWWW...............",
1497 "............WWWW...............",
1498 ".............WWW...............",
1499 "..............WW...............",
1500 "...............W...............",
1501 "...............................",
1502 "...............................",
1503 
1504 "...............................",
1505 "...............................",
1506 ".............WWWWW.............",
1507 ".............WWWWW.............",
1508 ".............WWWWW.............",
1509 ".............WWWWW.............",
1510 ".............WWWWW.............",
1511 ".............WWWWW.............",
1512 ".............WWWWW.............",
1513 ".............WWWWW.............",
1514 ".............WWWWW.............",
1515 ".............WWWWW.............",
1516 ".............WWWWW.............",
1517 ".............WWWWW.............",
1518 ".............WWWWW.............",
1519 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1520 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1521 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1522 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1523 "......WWWWWWWWWWWWWWWWWWW......",
1524 ".......WWWWWWWWWWWWWWWWW.......",
1525 "........WWWWWWWWWWWWWWW........",
1526 ".........WWWWWWWWWWWWW.........",
1527 "..........WWWWWWWWWWW..........",
1528 "...........WWWWWWWWW...........",
1529 "............WWWWWWW............",
1530 ".............WWWWW.............",
1531 "..............WWW..............",
1532 "...............W...............",
1533 "...............................",
1534 "...............................",
1535 
1536 "...............................",
1537 "...............................",
1538 "...............W...............",
1539 "...............WW..............",
1540 "...............WWW.............",
1541 "...............WWWW............",
1542 "...............WWWWW...........",
1543 "...............WWWWWW..........",
1544 "...............WWWWWWW.........",
1545 "...............WWWWWWWW........",
1546 "...............WWWWWWWWW.......",
1547 "...............WWWWWWWWWW......",
1548 "...............WWWWWWWWWWW.....",
1549 "..WWWWWWWWWWWWWWWWWWWWWWWWW....",
1550 "..WWWWWWWWWWWWWWWWWWWWWWWWWW...",
1551 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1552 "..WWWWWWWWWWWWWWWWWWWWWWWWWW...",
1553 "..WWWWWWWWWWWWWWWWWWWWWWWWW....",
1554 "...............WWWWWWWWWWW.....",
1555 "...............WWWWWWWWWW......",
1556 "...............WWWWWWWWW.......",
1557 "...............WWWWWWWW........",
1558 "...............WWWWWWW.........",
1559 "...............WWWWWW..........",
1560 "...............WWWWW...........",
1561 "...............WWWW............",
1562 "...............WWW.............",
1563 "...............WW..............",
1564 "...............W...............",
1565 "...............................",
1566 "...............................",
1567 
1568 "...............................",
1569 "...............................",
1570 "...............W...............",
1571 "..............WWW..............",
1572 ".............WWWWW.............",
1573 "............WWWWWWW............",
1574 "...........WWWWWWWWW...........",
1575 "..........WWWWWWWWWWW..........",
1576 ".........WWWWWWWWWWWWW.........",
1577 "........WWWWWWWWWWWWWWW........",
1578 ".......WWWWWWWWWWWWWWWWW.......",
1579 "......WWWWWWWWWWWWWWWWWWW......",
1580 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1581 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1582 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1583 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1584 ".............WWWWW.............",
1585 ".............WWWWW.............",
1586 ".............WWWWW.............",
1587 ".............WWWWW.............",
1588 ".............WWWWW.............",
1589 ".............WWWWW.............",
1590 ".............WWWWW.............",
1591 ".............WWWWW.............",
1592 ".............WWWWW.............",
1593 ".............WWWWW.............",
1594 ".............WWWWW.............",
1595 ".............WWWWW.............",
1596 ".............WWWWW.............",
1597 "...............................",
1598 "...............................",
1599 
1600 "...............................",
1601 "...............................",
1602 "...............W...............",
1603 "..............WW...............",
1604 ".............WWW...............",
1605 "............WWWW...............",
1606 "...........WWWWW...............",
1607 "..........WWWWWW...............",
1608 ".........WWWWWWW...............",
1609 "........WWWWWWWW...............",
1610 ".......WWWWWWWWW...............",
1611 "......WWWWWWWWWW...............",
1612 ".....WWWWWWWWWWW...............",
1613 "....WWWWWWWWWWWWWWWWWWWWWWWWW..",
1614 "...WWWWWWWWWWWWWWWWWWWWWWWWWW..",
1615 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1616 "...WWWWWWWWWWWWWWWWWWWWWWWWWW..",
1617 "....WWWWWWWWWWWWWWWWWWWWWWWWW..",
1618 ".....WWWWWWWWWWW...............",
1619 "......WWWWWWWWWW...............",
1620 ".......WWWWWWWWW...............",
1621 "........WWWWWWWW...............",
1622 ".........WWWWWWW...............",
1623 "..........WWWWWW...............",
1624 "...........WWWWW...............",
1625 "............WWWW...............",
1626 ".............WWW...............",
1627 "..............WW...............",
1628 "...............W...............",
1629 "...............................",
1630 "...............................",
1631 
1632 "...............................",
1633 "...............................",
1634 ".............WWWWW.............",
1635 ".............WWWWW.............",
1636 ".............WWWWW.............",
1637 ".............WWWWW.............",
1638 ".............WWWWW.............",
1639 ".............WWWWW.............",
1640 ".............WWWWW.............",
1641 ".............WWWWW.............",
1642 ".............WWWWW.............",
1643 ".............WWWWW.............",
1644 ".............WWWWW.............",
1645 ".............WWWWW.............",
1646 ".............WWWWW.............",
1647 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1648 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1649 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1650 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1651 "......WWWWWWWWWWWWWWWWWWW......",
1652 ".......WWWWWWWWWWWWWWWWW.......",
1653 "........WWWWWWWWWWWWWWW........",
1654 ".........WWWWWWWWWWWWW.........",
1655 "..........WWWWWWWWWWW..........",
1656 "...........WWWWWWWWW...........",
1657 "............WWWWWWW............",
1658 ".............WWWWW.............",
1659 "..............WWW..............",
1660 "...............W...............",
1661 "...............................",
1662 "...............................",
1663 
1664 "...............................",
1665 "...............................",
1666 "...............W...............",
1667 "...............WW..............",
1668 "...............WWW.............",
1669 "...............WWWW............",
1670 "...............WWWWW...........",
1671 "...............WWWWWW..........",
1672 "...............WWWWWWW.........",
1673 "...............WWWWWWWW........",
1674 "...............WWWWWWWWW.......",
1675 "...............WWWWWWWWWW......",
1676 "...............WWWWWWWWWWW.....",
1677 "..WWWWWWWWWWWWWWWWWWWWWWWWW....",
1678 "..WWWWWWWWWWWWWWWWWWWWWWWWWW...",
1679 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1680 "..WWWWWWWWWWWWWWWWWWWWWWWWWW...",
1681 "..WWWWWWWWWWWWWWWWWWWWWWWWW....",
1682 "...............WWWWWWWWWWW.....",
1683 "...............WWWWWWWWWW......",
1684 "...............WWWWWWWWW.......",
1685 "...............WWWWWWWW........",
1686 "...............WWWWWWW.........",
1687 "...............WWWWWW..........",
1688 "...............WWWWW...........",
1689 "...............WWWW............",
1690 "...............WWW.............",
1691 "...............WW..............",
1692 "...............W...............",
1693 "...............................",
1694 "...............................",
1695 
1696 "...............................",
1697 "...............................",
1698 "...............W...............",
1699 "..............WWW..............",
1700 ".............WWWWW.............",
1701 "............WWWWWWW............",
1702 "...........WWWWWWWWW...........",
1703 "..........WWWWWWWWWWW..........",
1704 ".........WWWWWWWWWWWWW.........",
1705 "........WWWWWWWWWWWWWWW........",
1706 ".......WWWWWWWWWWWWWWWWW.......",
1707 "......WWWWWWWWWWWWWWWWWWW......",
1708 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1709 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1710 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1711 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1712 ".............WWWWW.............",
1713 ".............WWWWW.............",
1714 ".............WWWWW.............",
1715 ".............WWWWW.............",
1716 ".............WWWWW.............",
1717 ".............WWWWW.............",
1718 ".............WWWWW.............",
1719 ".............WWWWW.............",
1720 ".............WWWWW.............",
1721 ".............WWWWW.............",
1722 ".............WWWWW.............",
1723 ".............WWWWW.............",
1724 ".............WWWWW.............",
1725 "...............................",
1726 "...............................",
1727 
1728 "...............................",
1729 "...............................",
1730 "...............W...............",
1731 "..............WW...............",
1732 ".............WWW...............",
1733 "............WWWW...............",
1734 "...........WWWWW...............",
1735 "..........WWWWWW...............",
1736 ".........WWWWWWW...............",
1737 "........WWWWWWWW...............",
1738 ".......WWWWWWWWW...............",
1739 "......WWWWWWWWWW...............",
1740 ".....WWWWWWWWWWW...............",
1741 "....WWWWWWWWWWWWWWWWWWWWWWWWW..",
1742 "...WWWWWWWWWWWWWWWWWWWWWWWWWW..",
1743 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1744 "...WWWWWWWWWWWWWWWWWWWWWWWWWW..",
1745 "....WWWWWWWWWWWWWWWWWWWWWWWWW..",
1746 ".....WWWWWWWWWWW...............",
1747 "......WWWWWWWWWW...............",
1748 ".......WWWWWWWWW...............",
1749 "........WWWWWWWW...............",
1750 ".........WWWWWWW...............",
1751 "..........WWWWWW...............",
1752 "...........WWWWW...............",
1753 "............WWWW...............",
1754 ".............WWW...............",
1755 "..............WW...............",
1756 "...............W...............",
1757 "...............................",
1758 "...............................",
1759 
1760 "...............................",
1761 "...............................",
1762 ".............WWWWW.............",
1763 ".............WWWWW.............",
1764 ".............WWWWW.............",
1765 ".............WWWWW.............",
1766 ".............WWWWW.............",
1767 ".............WWWWW.............",
1768 ".............WWWWW.............",
1769 ".............WWWWW.............",
1770 ".............WWWWW.............",
1771 ".............WWWWW.............",
1772 ".............WWWWW.............",
1773 ".............WWWWW.............",
1774 ".............WWWWW.............",
1775 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1776 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1777 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1778 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1779 "......WWWWWWWWWWWWWWWWWWW......",
1780 ".......WWWWWWWWWWWWWWWWW.......",
1781 "........WWWWWWWWWWWWWWW........",
1782 ".........WWWWWWWWWWWWW.........",
1783 "..........WWWWWWWWWWW..........",
1784 "...........WWWWWWWWW...........",
1785 "............WWWWWWW............",
1786 ".............WWWWW.............",
1787 "..............WWW..............",
1788 "...............W...............",
1789 "...............................",
1790 "...............................",
1791 
1792 "...............................",
1793 "...............W...............",
1794 "..............WWW..............",
1795 ".............WWWWW.............",
1796 "............WWWWWWW............",
1797 "...........WWWWWWWWW...........",
1798 "..........WWWWWWWWWWW..........",
1799 ".........WWWWWWWWWWWWW.........",
1800 "........WWWWWWWWWWWWWWW........",
1801 ".......WWWWWWWW.WWWWWWWW.......",
1802 "......WWWWWWWW...WWWWWWWW......",
1803 ".....WWWWWWWW.....WWWWWWWW.....",
1804 "....WWWWWWWW.......WWWWWWWW....",
1805 "...WWWWWWWW.........WWWWWWWW...",
1806 "..WWWWWWWW...........WWWWWWWW..",
1807 ".WWWWWWWW.............WWWWWWWW.",
1808 "..WWWWWWWW...........WWWWWWWW..",
1809 "...WWWWWWWW.........WWWWWWWW...",
1810 "....WWWWWWWW.......WWWWWWWW....",
1811 ".....WWWWWWWW.....WWWWWWWW.....",
1812 "......WWWWWWWW...WWWWWWWW......",
1813 ".......WWWWWWWW.WWWWWWWW.......",
1814 "........WWWWWWWWWWWWWWW........",
1815 ".........WWWWWWWWWWWWW.........",
1816 "..........WWWWWWWWWWW..........",
1817 "...........WWWWWWWWW...........",
1818 "............WWWWWWW............",
1819 ".............WWWWW.............",
1820 "..............WWW..............",
1821 "...............W...............",
1822 "...............................",
1823 
1824 "...............................",
1825 "...............W...............",
1826 "..............WWW..............",
1827 ".............WWWWW.............",
1828 "............WWWWWWW............",
1829 "...........WWWWWWWWW...........",
1830 "..........WWWWWWWWWWW..........",
1831 ".........WWWWWWWWWWWWW.........",
1832 "........WWWWWWWWWWWWWWW........",
1833 ".......WWWWWWWW.WWWWWWWW.......",
1834 "......WWWWWWWW...WWWWWWWW......",
1835 ".....WWWWWWWW.....WWWWWWWW.....",
1836 "....WWWWWWWW.......WWWWWWWW....",
1837 "...WWWWWWWW.........WWWWWWWW...",
1838 "..WWWWWWWW...........WWWWWWWW..",
1839 ".WWWWWWWW.............WWWWWWWW.",
1840 "..WWWWWWWW...........WWWWWWWW..",
1841 "...WWWWWWWW.........WWWWWWWW...",
1842 "....WWWWWWWW.......WWWWWWWW....",
1843 ".....WWWWWWWW.....WWWWWWWW.....",
1844 "......WWWWWWWW...WWWWWWWW......",
1845 ".......WWWWWWWW.WWWWWWWW.......",
1846 "........WWWWWWWWWWWWWWW........",
1847 ".........WWWWWWWWWWWWW.........",
1848 "..........WWWWWWWWWWW..........",
1849 "...........WWWWWWWWW...........",
1850 "............WWWWWWW............",
1851 ".............WWWWW.............",
1852 "..............WWW..............",
1853 "...............W...............",
1854 "...............................",
1855 
1856 "...............................",
1857 "...............W...............",
1858 "..............WWW..............",
1859 ".............WWWWW.............",
1860 "............WWWWWWW............",
1861 "...........WWWWWWWWW...........",
1862 "..........WWWWWWWWWWW..........",
1863 ".........WWWWWWWWWWWWW.........",
1864 "........WWWWWWWWWWWWWWW........",
1865 ".......WWWWWWWWWWWWWWWWW.......",
1866 "......WWWWWWWWWWWWWWWWWWW......",
1867 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1868 "....WWWWWWWW.......WWWWWWWW....",
1869 "...WWWWWWWWW.......WWWWWWWWW...",
1870 "..WWWWWWWWWW.......WWWWWWWWWW..",
1871 ".WWWWWWWWWWW.......WWWWWWWWWWW.",
1872 "..WWWWWWWWWW.......WWWWWWWWWW..",
1873 "...WWWWWWWWW.......WWWWWWWWW...",
1874 "....WWWWWWWW.......WWWWWWWW....",
1875 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1876 "......WWWWWWWWWWWWWWWWWWW......",
1877 ".......WWWWWWWWWWWWWWWWW.......",
1878 "........WWWWWWWWWWWWWWW........",
1879 ".........WWWWWWWWWWWWW.........",
1880 "..........WWWWWWWWWWW..........",
1881 "...........WWWWWWWWW...........",
1882 "............WWWWWWW............",
1883 ".............WWWWW.............",
1884 "..............WWW..............",
1885 "...............W...............",
1886 "...............................",
1887 
1888 "...............................",
1889 "...............W...............",
1890 "..............WWW..............",
1891 ".............WWWWW.............",
1892 "............WWWWWWW............",
1893 "...........WWWWWWWWW...........",
1894 "..........WWWWWWWWWWW..........",
1895 ".........WWWWWWWWWWWWW.........",
1896 "........WWWWWWWWWWWWWWW........",
1897 ".......WWWWWWWWWWWWWWWWW.......",
1898 "......WWWWWWWWWWWWWWWWWWW......",
1899 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1900 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1901 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1902 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1903 ".WWWWWWWWWWWWWWWWWWWWWWWWWWWWW.",
1904 "..WWWWWWWWWWWWWWWWWWWWWWWWWWW..",
1905 "...WWWWWWWWWWWWWWWWWWWWWWWWW...",
1906 "....WWWWWWWWWWWWWWWWWWWWWWW....",
1907 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1908 "......WWWWWWWWWWWWWWWWWWW......",
1909 ".......WWWWWWWWWWWWWWWWW.......",
1910 "........WWWWWWWWWWWWWWW........",
1911 ".........WWWWWWWWWWWWW.........",
1912 "..........WWWWWWWWWWW..........",
1913 "...........WWWWWWWWW...........",
1914 "............WWWWWWW............",
1915 ".............WWWWW.............",
1916 "..............WWW..............",
1917 "...............W...............",
1918 "...............................",
1919 
1920 
1921 "...............................",
1922 "...............W...............",
1923 "..............WWW..............",
1924 ".............WWWWW.............",
1925 "............WWWWWWW............",
1926 "...........WWWWWWWWW...........",
1927 "..........WWWWWWWWWWW..........",
1928 ".........WWWWWWWWWWWWW.........",
1929 "........WWWW.......WWWW........",
1930 ".......WWWWW.......WWWWW.......",
1931 "......WWWWWW.......WWWWWW......",
1932 ".....WWWWWWW.......WWWWWWW.....",
1933 "....WWWWWWWW.......WWWWWWWW....",
1934 "...WWWWWWWWW.......WWWWWWWWW...",
1935 "..WWWWWWWWWW.......WWWWWWWWWW..",
1936 ".WWWWWWWWWWW.......WWWWWWWWWWW.",
1937 "..WWWWWWWWWW.......WWWWWWWWWW..",
1938 "...WWWWWWWWW.......WWWWWWWWW...",
1939 "....WWWWWWWW.......WWWWWWWW....",
1940 ".....WWWWWWW.......WWWWWWW.....",
1941 "......WWWWWW.......WWWWWW......",
1942 ".......WWWWW.......WWWWW.......",
1943 "........WWWW.......WWWW........",
1944 ".........WWWWWWWWWWWWW.........",
1945 "..........WWWWWWWWWWW..........",
1946 "...........WWWWWWWWW...........",
1947 "............WWWWWWW............",
1948 ".............WWWWW.............",
1949 "..............WWW..............",
1950 "...............W...............",
1951 "...............................",
1952 
1953 "...............................",
1954 "...............W...............",
1955 "..............WWW..............",
1956 ".............WWWWW.............",
1957 "............WWWWWWW............",
1958 "...........WWWWWWWWW...........",
1959 "..........WWWWWWWWWWW..........",
1960 ".........WWWWWWWWWWWWW.........",
1961 "........WWWWWWWWWWWWWWW........",
1962 ".......WWWWWWWWWWWWWWWWW.......",
1963 "......WWWWWWWWWWWWWWWWWWW......",
1964 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1965 "....WWWW...............WWWW....",
1966 "...WWWWW...............WWWWW...",
1967 "..WWWWWW...............WWWWWW..",
1968 ".WWWWWWW...............WWWWWWW.",
1969 "..WWWWWW...............WWWWWW..",
1970 "...WWWWW...............WWWWW...",
1971 "....WWWW...............WWWW....",
1972 ".....WWWWWWWWWWWWWWWWWWWWW.....",
1973 "......WWWWWWWWWWWWWWWWWWW......",
1974 ".......WWWWWWWWWWWWWWWWW.......",
1975 "........WWWWWWWWWWWWWWW........",
1976 ".........WWWWWWWWWWWWW.........",
1977 "..........WWWWWWWWWWW..........",
1978 "...........WWWWWWWWW...........",
1979 "............WWWWWWW............",
1980 ".............WWWWW.............",
1981 "..............WWW..............",
1982 "...............W...............",
1983 "...............................",
1984 
1985 "...............................",
1986 "...............W...............",
1987 "..............WWW..............",
1988 ".............WWWWW.............",
1989 "............WWWWWWW............",
1990 "...........WWWWWWWWW...........",
1991 "..........WWWWWWWWWWW..........",
1992 ".........WWWWWWWWWWWWW.........",
1993 "........WWW.WWWWWWW.WWW........",
1994 ".......WWW...WWWWW...WWW.......",
1995 "......WWW.....WWW.....WWW......",
1996 ".....WWW.......W.......WWW.....",
1997 "....WWWWW.............WWWWW....",
1998 "...WWWWWWW...........WWWWWWW...",
1999 "..WWWWWWWWW.........WWWWWWWWW..",
2000 ".WWWWWWWWWWW.......WWWWWWWWWWW.",
2001 "..WWWWWWWWW.........WWWWWWWWW..",
2002 "...WWWWWWW...........WWWWWWW...",
2003 "....WWWWW.............WWWWW....",
2004 ".....WWW.......W.......WWW.....",
2005 "......WWW.....WWW.....WWW......",
2006 ".......WWW...WWWWW...WWW.......",
2007 "........WWW.WWWWWWW.WWW........",
2008 ".........WWWWWWWWWWWWW.........",
2009 "..........WWWWWWWWWWW..........",
2010 "...........WWWWWWWWW...........",
2011 "............WWWWWWW............",
2012 ".............WWWWW.............",
2013 "..............WWW..............",
2014 "...............W...............",
2015 "..............................."};
2016 
2017 // colors for each cell state (we try to match colors used in icons)
2018 static unsigned char jvncolors[] = {
2019     48,  48,  48,    // 0  dark gray
2020    255,   0,   0,    // 1  red
2021    255, 125,   0,    // 2  orange (to match red and yellow)
2022    255, 150,  25,    // 3   lighter
2023    255, 175,  50,    // 4    lighter
2024    255, 200,  75,    // 5     lighter
2025    255, 225, 100,    // 6      lighter
2026    255, 250, 125,    // 7       lighter
2027    251, 255,   0,    // 8  yellow
2028     89,  89, 255,    // 9  blue
2029    106, 106, 255,    // 10  lighter
2030    122, 122, 255,    // 11   lighter
2031    139, 139, 255,    // 12    lighter
2032     27, 176,  27,    // 13 green
2033     36, 200,  36,    // 14  lighter
2034     73, 255,  73,    // 15   lighter
2035    106, 255, 106,    // 16    lighter
2036    235,  36,  36,    // 17 red
2037    255,  56,  56,    // 18  lighter
2038    255,  73,  73,    // 19   lighter
2039    255,  89,  89,    // 20    lighter
2040    185,  56, 255,    // 21 purple
2041    191,  73, 255,    // 22  lighter
2042    197,  89, 255,    // 23   lighter
2043    203, 106, 255,    // 24    lighter
2044      0, 255, 128,    // 25 light green
2045    255, 128,  64,    // 26 light orange
2046    255, 255, 128,    // 27 light yellow
2047     33, 215, 215,    // 28 cyan
2048     27, 176, 176,    // 29  darker
2049     24, 156, 156,    // 30   darker
2050     21, 137, 137     // 31    darker
2051 };
2052 
creator()2053 static lifealgo *creator() { return new jvnalgo() ; }
2054 
doInitializeAlgoInfo(staticAlgoInfo & ai)2055 void jvnalgo::doInitializeAlgoInfo(staticAlgoInfo &ai) {
2056    ghashbase::doInitializeAlgoInfo(ai) ;
2057    ai.setAlgorithmName("JvN") ;
2058    ai.setAlgorithmCreator(&creator) ;
2059    ai.minstates = 29 ;
2060    ai.maxstates = 32 ;
2061    // init default color scheme
2062    ai.defgradient = false;
2063    ai.defr1 = ai.defg1 = ai.defb1 = 255;     // start color = white
2064    ai.defr2 = ai.defg2 = ai.defb2 = 128;     // end color = gray
2065    int numcolors = sizeof(jvncolors) / (sizeof(jvncolors[0])*3);
2066    unsigned char* rgbptr = jvncolors;
2067    for (int i = 0; i < numcolors; i++) {
2068       ai.defr[i] = *rgbptr++;
2069       ai.defg[i] = *rgbptr++;
2070       ai.defb[i] = *rgbptr++;
2071    }
2072    // init default icon data
2073    ai.defxpm7x7 = jvn7x7;
2074    ai.defxpm15x15 = jvn15x15;
2075    ai.defxpm31x31 = jvn31x31;
2076 }
2077 
2078 // ------------------- beginning of Hutton32 section -----------------------
2079 
2080 	/***
2081 
2082 Motivation: In the original von Neumann transition rules, lines of transmission states can
2083 extend themselves by writing out binary signal trains, e.g. 10000 for extend with a right-directed
2084 ordinary transmission state (OTS). But for construction, a dual-stranded construction arm (c-arm)
2085 is needed, simply because the arm must be retracted after each write. I noticed that there was room
2086 to add the needed write-and-retract operation by modifying the transition rules slightly. This
2087 allows the machine to be greatly reduced in size and speed of replication.
2088 
2089 Another modification was made when it was noticed that the construction could be made rotationally
2090 invariant simply by basing the orientation of the written cell on the orientation of the one writing
2091 it. Instead of "write an up arrow" we have "turn left". This allows us to spawn offspring in
2092 different directions and to fill up the space with more and more copies in a manner inspired by
2093 Langton's Loops.
2094 
2095 A single OTS line can now act as a c-arm in any direction. Below are the signal trains:
2096 
2097 100000 : move forward (write an OTS arrow in the same direction)
2098 100010 : turn left
2099 10100  : turn right
2100 100001 : write a forward-directed OTS and retract
2101 100011 : write a left-directed OTS and retract
2102 10011  : write a reverse-directed OTS and retract
2103 10101  : write a right-directed OTS and retract
2104 101101 : write a forward-directed special transmission state (STS) and retract
2105 110001 : write a left-directed STS and retract
2106 110101 : write a reverse-directed STS and retract
2107 111001 : write a right-directed STS and retract
2108 1111   : write a confluent state and retract
2109 101111 : retract
2110 
2111 Achieving these features without adding new states required making some slight changes elsewhere,
2112 though hopefully these don't affect the computation- or construction-universality of the CA. The
2113 most important effects are listed here:
2114 
2115 1) OTS's cannot destroy STS's. This functionality was used in von Neumann's construction and
2116 read-write arms but isn't needed for the logic organs, as far as I know. The opposite operation
2117 is still enabled.
2118 2) STS lines can only construct one cell type: an OTS in the forward direction. Some logic organs
2119 will need to be redesigned.
2120 
2121 Under this modified JvN rule, a self-replicator can be much smaller, consisting only of a tape
2122 contained within a repeater-emitter loop. One early example consisted of 5521 cells in total, and
2123 replicates in 44,201 timesteps, compared with 8 billion timesteps for the smallest known JvN-32
2124 replicator. This became possible because the construction process runs at the same speed as a moving
2125 signal, allowing the tape to be simply stored in a repeater-emitter loop. The machine simply creates
2126 a loop of the right size (by counting tape circuits) before allowing the tape contents to fill up
2127 their new home.
2128 
2129 The rotational invariance allows the machine to make multiple copies oriented in different directions.
2130 The population growth starts off as exponential but soons slows down as the long tapes obstruct the
2131 new copies.
2132 
2133 Some context for these modifications to von Neumann's rule table:
2134 Codd simplified vN's CA to a rotationally-invariant 8 states. Langton modified this to make a
2135 self-replicating repeater-emitter, his 'loops'. Other loops were made by Sayama, Perrier, Tempesti,
2136 Byl, Chou-Reggia, and others. So there are other CA derived from vN's that support faster replication
2137 than that achieveable here, and some of them retain the computation- and construction-universality
2138 that von Neumann was considering. Our modifications are mostly a historical exploration of the
2139 possibility space around vN's CA, to explore the questions of why he made the design decisions he did.
2140 In particular, why didn't von Neumann design for a tape loop stored within a repeater-emitter? It would
2141 have made his machine much simpler from the beginning. Why didn't he consider write-and-retraction
2142 instead of designing a complicated c-arm procedure? Of course this is far from criticism of vN - his
2143 untimely death interrupted his work in this area.
2144 
2145 Some explanation of the details of the modifications is given below:
2146 
2147 The transition rules are as in Nobili32 (or JvN29), except the following:
2148 1) The end of an OTS wire, when writing a new cell, adopts one of two states: excited OTS and excited
2149 STS, standing for bits 1 and 0 respectively. After writing the cell reverts to being an OTS.
2150 2) A sensitized cell that is about to revert to an arrow bases its direction upon that of the excited
2151 arrow that is pointing to it.
2152 3) A TS 'c', with a sensitized state 's' on its output that will become an OTS next (based on the
2153 state of 'c'), reverts to the ground state if any of 'c's input is 1, else it quiesces.
2154 4) A TS 'c', with a sensitized state 's' on its output that will become a confluent state next
2155 (based on the state of 'c'), reverts to the first sensitized state S is any of 'c's input is one,
2156 else it reverts to the ground state.
2157 5) A TS 'c', with an STS on its output, reverts to the ground state if any of 'c's input is 1.
2158 
2159 Tim Hutton <tim.hutton@gmail.com>, 2008
2160 
2161 	***/
2162 
is_OTS(state c)2163 bool is_OTS(state c) {
2164 	return c>=9 && c<=16;
2165 }
is_STS(state c)2166 bool is_STS(state c) {
2167 	return c>=17 && c<=24;
2168 }
is_TS(state c)2169 bool is_TS(state c) {
2170 	return is_OTS(c) || is_STS(c);
2171 }
is_sensitized(state c)2172 bool is_sensitized(state c) {
2173 	return c>=1 && c<=8;
2174 }
is_east(state c)2175 bool is_east(state c) {
2176 	return c==9 || c==13 || c==17 || c==21;
2177 }
is_north(state c)2178 bool is_north(state c) {
2179 	return c==10 || c==14 || c==18 || c==22;
2180 }
is_west(state c)2181 bool is_west(state c) {
2182 	return c==11 || c==15 || c==19 || c==23;
2183 }
is_south(state c)2184 bool is_south(state c) {
2185 	return c==12 || c==16 || c==20 || c==24;
2186 }
is_excited(state c)2187 bool is_excited(state c) {
2188 	return (c>=13 && c<=16) || (c>=21 && c<=24);
2189 }
dir(state c)2190 state dir(state c) {	// return 0,1,2,3 encoding the direction of 'c': right,up,left,down
2191 	return (c-9)%4;
2192 }
output(state c,state n,state s,state e,state w)2193 state output(state c,state n,state s,state e,state w) // what is the state of the cell we are pointing to?
2194 {
2195 	if(is_east(c)) return e;
2196 	else if(is_north(c)) return n;
2197 	else if(is_west(c)) return w;
2198 	else if(is_south(c)) return s;
2199 	else return 0; // error
2200 }
input(state n,state s,state e,state w)2201 state input(state n,state s,state e,state w)	// what is the state of the excited cell pointing at us?
2202 {
2203 	if(is_east(w) && is_excited(w)) return w;
2204 	else if(is_north(s) && is_excited(s)) return s;
2205 	else if(is_west(e) && is_excited(e)) return e;
2206 	else if(is_south(n) && is_excited(n)) return n;
2207 	else return 0; // error
2208 }
output_will_become_OTS(state c,state n,state s,state e,state w)2209 bool output_will_become_OTS(state c,state n,state s,state e,state w)
2210 {
2211 	return output(c,n,s,e,w)==8
2212 		|| (output(c,n,s,e,w)==4 && is_excited(c))
2213 		|| (output(c,n,s,e,w)==5 && !is_excited(c));
2214 }
output_will_become_confluent(state c,state n,state s,state e,state w)2215 bool output_will_become_confluent(state c,state n,state s,state e,state w)
2216 {
2217 	return output(c,n,s,e,w)==7 && is_excited(c);
2218 }
output_will_become_sensitized(state c,state n,state s,state e,state w)2219 bool output_will_become_sensitized(state c,state n,state s,state e,state w)
2220 {
2221 	int out=output(c,n,s,e,w);
2222 	return ((out==0 && is_excited(c)) || out==1 || out==2 || out==3 || (out==4 && !is_OTS(c)));
2223 }
excited_arrow_to_us(state n,state s,state e,state w)2224 bool excited_arrow_to_us(state n,state s,state e,state w)
2225 {
2226 	return n==16 || n==24 || s==14 || s==22 || e==15 || e==23 || w==13 || w==21;
2227 }
excited_OTS_to_us(state c,state n,state s,state e,state w)2228 bool excited_OTS_to_us(state c,state n,state s,state e,state w) { // is there an excited OTS state that will hit us next?
2229 	return ((n==16 || n==27 || n==28 || n==30 || n==31) && !(c==14 || c==10))
2230 		|| ((s==14 || s==27 || s==28 || s==30 || s==31) && !(c==16 || c==12))
2231 		|| ((e==15 || e==27 || e==28 || e==29 || e==31) && !(c==13 || c==9))
2232 		|| ((w==13 || w==27 || w==28 || w==29 || w==31) && !(c==15 || c==11));
2233 }
excited_OTS_arrow_to_us(state c,state n,state s,state e,state w)2234 bool excited_OTS_arrow_to_us(state c,state n,state s,state e,state w) { // is there an excited OTS arrow pointing at us?
2235 	return (n==16 && !(c==14 || c==10))
2236 		|| (s==14 && !(c==16 || c==12))
2237 		|| (e==15 && !(c==13 || c==9))
2238 		|| (w==13 && !(c==15 || c==11));
2239 }
OTS_arrow_to_us(state n,state s,state e,state w)2240 bool OTS_arrow_to_us(state n,state s,state e,state w) {	// is there an OTS arrow pointing at us?
2241 	return (is_OTS(n) && is_south(n)) || (is_OTS(s) && is_north(s))
2242 		|| (is_OTS(e) && is_west(e)) || (is_OTS(w) && is_east(w));
2243 }
excited_STS_to_us(state c,state n,state s,state e,state w)2244 bool excited_STS_to_us(state c,state n,state s,state e,state w) { // is there an excited STS state that will hit us next?
2245 	return ((n==24 || n==27 || n==28 || n==30 || n==31) && !(c==22 || c==18))
2246 		|| ((s==22 || s==27 || s==28 || s==30 || s==31) && !(c==24 || c==20))
2247 		|| ((e==23 || e==27 || e==28 || e==29 || e==31) && !(c==21 || c==17))
2248 		|| ((w==21 || w==27 || w==28 || w==29 || w==31) && !(c==23 || c==19));
2249 }
excited_STS_arrow_to_us(state c,state n,state s,state e,state w)2250 bool excited_STS_arrow_to_us(state c,state n,state s,state e,state w) { // is there an excited STS arrow pointing at us?
2251 	return (n==24 && !(c==22 || c==18))
2252 		|| (s==22 && !(c==24 || c==20))
2253 		|| (e==23 && !(c==21 || c==17))
2254 		|| (w==21 && !(c==23 || c==19));
2255 }
all_inputs_on(state n,state s,state e,state w)2256 bool all_inputs_on(state n,state s,state e,state w) {
2257 	return (!(n==12 || s==10 || e==11 || w==9)) && (n==16 || s==14 || e==15 || w==13);
2258 }
is_crossing(state n,state s,state e,state w)2259 bool is_crossing(state n,state s,state e,state w)
2260 {
2261 	int n_inputs=0;
2262 	if(is_south(n)) n_inputs++;
2263 	if(is_east(w)) n_inputs++;
2264 	if(is_west(e)) n_inputs++;
2265 	if(is_north(s)) n_inputs++;
2266 	int n_outputs=0;
2267 	if(is_TS(n) && !is_south(n)) n_outputs++;
2268 	if(is_TS(w) && !is_east(w)) n_outputs++;
2269 	if(is_TS(e) && !is_west(e)) n_outputs++;
2270 	if(is_TS(s) && !is_north(s)) n_outputs++;
2271 	return n_inputs==2 && n_outputs==2;
2272 }
quiesce(state c)2273 state quiesce(state c)
2274 {
2275 	if(((c>=13 && c<=16) || (c>=21 && c<=24)))
2276 		return c-4;
2277 	else if(c>=26 && c<=31)
2278 		return 25;
2279 	else
2280 		return c;
2281 }
2282 // the update function itself
slowcalc_Hutton32(state c,state n,state s,state e,state w)2283 state slowcalc_Hutton32(state c,state n,state s,state e,state w)
2284 {
2285 	if(is_OTS(c))
2286 	{
2287 		if(excited_STS_arrow_to_us(c,n,s,e,w))
2288 			return 0;		// we get destroyed by the incoming excited STS
2289 		else if(excited_OTS_to_us(c,n,s,e,w))
2290 		{
2291 			if(output_will_become_OTS(c,n,s,e,w) || (is_STS(output(c,n,s,e,w)) && !is_excited(output(c,n,s,e,w))))
2292 				return 0;	// we become the ground state (retraction)
2293 			else if(output_will_become_confluent(c,n,s,e,w))
2294 				return 1;	// we become sensitized by the next input (after retraction)
2295 			else
2296 				return quiesce(c)+4;	// we become excited (usual OTS transmission)
2297 		}
2298 		else if(output_will_become_confluent(c,n,s,e,w))
2299 			return 0;		// we become the ground state (retraction)
2300 		else if(is_excited(c) && output_will_become_sensitized(c,n,s,e,w))
2301 			return quiesce(c)+12;	// we become excited STS (special for end-of-wire:
2302 					// means quiescent OTS, used to mark which cell is the sensitized cell's input)
2303 		else
2304 			return quiesce(c);
2305 	}
2306 	else if(is_STS(c))
2307 	{
2308 		if(is_excited(c) && is_sensitized(output(c,n,s,e,w)) && OTS_arrow_to_us(n,s,e,w))
2309 		{
2310 			// this cell is the special mark at the end of an OTS wire, so it behaves differently
2311 			// if output is about to finalize, we revert to ground or quiescent OTS, depending on next signal
2312 			// if output will remain sensitized, we change to excited OTS if next signal is 1
2313 			if(output_will_become_sensitized(c,n,s,e,w))
2314 			{
2315 				if(excited_OTS_arrow_to_us(c,n,s,e,w))
2316 					return c-8;
2317 				else
2318 					return c;
2319 			}
2320 			else {
2321 				if(excited_OTS_arrow_to_us(c,n,s,e,w))
2322 					return 0;	// write-and-retract
2323 				else
2324 					return quiesce(c)-8;	// revert to quiescent OTS
2325 			}
2326 		}
2327 		else if(is_excited(c) && output(c,n,s,e,w)==0)
2328 			if(excited_STS_arrow_to_us(c,n,s,e,w))
2329 				return c;	// we remain excited
2330 			else
2331 				return quiesce(c);	// we quiesce
2332 		else if(excited_OTS_arrow_to_us(c,n,s,e,w))
2333 			return 0;	// we get destroyed by the incoming excited OTS
2334 		else if(excited_STS_to_us(c,n,s,e,w))
2335 			return quiesce(c)+4;	// we become excited (usual STS transmission)
2336 		else
2337 			 return quiesce(c);	// we quiesce (usual STS transmission)
2338 	}
2339 	else if(c==0)
2340 	{
2341 		if(excited_OTS_arrow_to_us(c,n,s,e,w)) // (excludes e.g. excited confluent states)
2342 			return 1;	// we become sensitized
2343 		else if(excited_STS_arrow_to_us(c,n,s,e,w))
2344 			return quiesce(input(n,s,e,w))-8;	// directly become 'forward' OTS
2345 		else return c;
2346 	}
2347 	else if(c==1)
2348 	{
2349 		if(!excited_OTS_arrow_to_us(c,n,s,e,w))
2350 			return 2; 	// 10
2351 		else
2352 			return 3;	// 11
2353 	}
2354 	else if(c==2)
2355 	{
2356 		if(!excited_OTS_arrow_to_us(c,n,s,e,w))
2357 			return 4;	// 100
2358 		else
2359 			return 5;	// 101
2360 	}
2361 	else if(c==3)
2362 	{
2363 		if(!excited_OTS_arrow_to_us(c,n,s,e,w))
2364 			return 6; 	// 110
2365 		else
2366 			return 7;	// 111
2367 	}
2368 	else if(c==4)
2369 	{
2370 		if(!excited_OTS_arrow_to_us(c,n,s,e,w))
2371 			return 8; 	// 1000
2372 		else
2373 			return ( (quiesce(input(n,s,e,w))-9+2) % 4 )+9;	// 1001: reverse
2374 	}
2375 	else if(c==5)
2376 	{
2377 		if(!excited_OTS_arrow_to_us(c,n,s,e,w))
2378 			return ( (quiesce(input(n,s,e,w))-9+3) % 4 )+9; 	// 1010: turn right
2379 		else
2380 			return quiesce(input(n,s,e,w))+8;	// 1011: STS forward
2381 	}
2382 	else if(c==6)
2383 	{
2384 		if(!excited_OTS_arrow_to_us(c,n,s,e,w))
2385 			return ( (quiesce(input(n,s,e,w))-9+1) % 4 )+17; 	// 1100: STS turn left
2386 		else
2387 			return ( (quiesce(input(n,s,e,w))-9+2) % 4 )+17;	// 1101: STS reverse
2388 	}
2389 	else if(c==7)
2390 	{
2391 		if(!excited_OTS_arrow_to_us(c,n,s,e,w))
2392 			return ( (quiesce(input(n,s,e,w))-9+3) % 4 )+17; 	// 1110: STS turn left
2393 		else
2394 			return 25;	// 1111
2395 	}
2396 	else if(c==8)
2397 	{
2398 		if(!excited_OTS_arrow_to_us(c,n,s,e,w))
2399 			return 9+dir(input(n,s,e,w)); 	// 10000: move forward
2400 		else
2401 			return 9+dir(input(n,s,e,w)+1);	// 10001: turn left
2402 	}
2403 	else if(c==25) 	// quiescent confluent state
2404 	{
2405 		if(excited_STS_arrow_to_us(c,n,s,e,w))
2406 			return 0;	// we get destroyed by the incoming excited STS
2407 		else if(is_crossing(n,s,e,w)) // for JvN-32 crossings
2408 		{
2409 			if((n==16||s==14)&&(e==15||w==13))
2410 				return 31;	// double crossing
2411 			else if(n==16||s==14)
2412 				return 30;	// vertical crossing
2413 			else if(e==15||w==13)
2414 				return 29;	// horizontal crossing
2415 			else
2416 				return 25;	// nothing happening
2417 		}
2418 		else if(all_inputs_on(n,s,e,w))
2419 			return 26;
2420 		else
2421 			return 25;
2422 	}
2423 	else if(c==26)
2424 	{
2425 		if(excited_STS_arrow_to_us(c,n,s,e,w))
2426 			return 0;	// we get destroyed by the incoming excited STS
2427 		else if(all_inputs_on(n,s,e,w))
2428 			return 28;
2429 		else
2430 			return 27;
2431 	}
2432 	else if(c==27)
2433 	{
2434 		if(excited_STS_arrow_to_us(c,n,s,e,w))
2435 			return 0;	// we get destroyed by the incoming excited STS
2436 		else if(all_inputs_on(n,s,e,w))
2437 			return 26;
2438 		else
2439 			return 25;
2440 	}
2441 	else if(c==28)
2442 	{
2443 		if(excited_STS_arrow_to_us(c,n,s,e,w))
2444 			return 0;	// we get destroyed by the incoming excited STS
2445 		else if(all_inputs_on(n,s,e,w))
2446 			return 28;
2447 		else
2448 			return 27;
2449 	}
2450 	else if(c==29 || c==30 || c==31)
2451 	{
2452 		if(excited_STS_arrow_to_us(c,n,s,e,w))
2453 			return 0;	// we get destroyed by the incoming excited STS
2454 		else if((n==16||s==14)&&(e==15||w==13))
2455 			return 31;	// double crossing
2456 		else if(n==16||s==14)
2457 			return 30;	// vertical crossing
2458 		else if(e==15||w==13)
2459 			return 29;	// horizontal crossing
2460 		else
2461 			return 25;	// revert to quiescent confluent state
2462 	}
2463 	else
2464 		return c;	// error - should be no more states
2465 }
2466 // ------------------ end of Hutton32 section -------------------------
2467 
2468