fork(1) download
  1. t(){ tr 0-8a-i $b$b
  2. }
  3. p(){ t<<E
  4. 0-1-2
  5. |\|/|
  6. 3-4-5
  7. |/|\|
  8. 6-7-8
  9.  
  10. E
  11. }
  12. g(){ b=`tr $x$e $e$x<<<012345678|t`
  13. p
  14. e=$x
  15. }
  16. b=bbbbowwww
  17. e=4
  18. m=0
  19. p
  20. while [ $m != 5 ]&&read x;do
  21. g
  22. m=0
  23. for y in {0..8};do
  24. s=0
  25. S=05011234
  26. grep -E "w.*($y$e|$e$y)"<<<${b:$y:1}30125876340142548746>/dev/null&&for p in wow.\*/ww wow.\*/w bbo.\*/b obb.\*/b www wbw .
  27. do
  28. ((s++))
  29. tr $y$e $e$y<<<3012587630/4e|t|grep $p>/dev/null&&break
  30. done
  31. s=${S:$s:1}
  32. [ $s -gt $m ]&&m=$s x=$y
  33. done
  34. g
  35. done
Success #stdin #stdout 0.07s 5308KB
stdin
2
4
5
1
0
4
3
0
stdout
b-b-b
|\|/|
b-o-w
|/|\|
w-w-w

b-b-o
|\|/|
b-b-w
|/|\|
w-w-w

b-b-w
|\|/|
b-b-o
|/|\|
w-w-w

b-b-w
|\|/|
b-o-b
|/|\|
w-w-w

b-b-w
|\|/|
b-w-b
|/|\|
w-w-o

b-b-w
|\|/|
b-w-o
|/|\|
w-w-b

b-b-o
|\|/|
b-w-w
|/|\|
w-w-b

b-o-b
|\|/|
b-w-w
|/|\|
w-w-b

b-w-b
|\|/|
b-o-w
|/|\|
w-w-b

o-w-b
|\|/|
b-b-w
|/|\|
w-w-b

w-o-b
|\|/|
b-b-w
|/|\|
w-w-b

w-b-b
|\|/|
b-o-w
|/|\|
w-w-b

o-b-b
|\|/|
b-w-w
|/|\|
w-w-b

b-b-b
|\|/|
o-w-w
|/|\|
w-w-b

b-b-b
|\|/|
w-w-w
|/|\|
o-w-b