Skip to main content
added 252 characters in body
Source Link
tsh
  • 36.2k
  • 2
  • 36
  • 133

JavaScript (Node.js), 100 bytes

s=>(i=1e4,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``.toString(2).slice(1)

Try it online!

Input a string, output 13 char 0-1 string.


JavaScript (Node.js), 77 bytes

s=>(i=0,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``

Try it online!

Input string as format 'x oxx o', output an integer in range \$\left[0,6105\right]\$.


We encoded all 6046 valid boards together with another 59 invalid ones into number not greater than 6105. The bit string output version also added an extra 1808 to each output so they actually encoded in range \$\left[1808, 7913\right]\$.

JavaScript (Node.js), 100 bytes

s=>(i=1e4,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``.toString(2).slice(1)

Try it online!

Input a string, output 13 char 0-1 string.


JavaScript (Node.js), 77 bytes

s=>(i=0,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``

Try it online!

Input string as format 'x oxx o', output an integer in range \$\left[0,6105\right]\$.

JavaScript (Node.js), 100 bytes

s=>(i=1e4,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``.toString(2).slice(1)

Try it online!

Input a string, output 13 char 0-1 string.


JavaScript (Node.js), 77 bytes

s=>(i=0,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``

Try it online!

Input string as format 'x oxx o', output an integer in range \$\left[0,6105\right]\$.


We encoded all 6046 valid boards together with another 59 invalid ones into number not greater than 6105. The bit string output version also added an extra 1808 to each output so they actually encoded in range \$\left[1808, 7913\right]\$.

added 585 characters in body
Source Link
tsh
  • 36.2k
  • 2
  • 36
  • 133

JavaScript (Node.js), 100 bytes

s=>(i=1e4,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``.toString(2).slice(1)

Try it online!

Input a string, output 13 char 0-1 string.


JavaScript (Node.js), 77 bytes

s=>(i=0,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``

Try it online!

Input string as format 'x oxx o', output an integer in range \$\left[0,6105\right]\$.

JavaScript (Node.js), 77 bytes

s=>(i=0,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``

Try it online!

Input string as format 'x oxx o', output an integer in range \$\left[0,6105\right]\$.

JavaScript (Node.js), 100 bytes

s=>(i=1e4,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``.toString(2).slice(1)

Try it online!

Input a string, output 13 char 0-1 string.


JavaScript (Node.js), 77 bytes

s=>(i=0,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``

Try it online!

Input string as format 'x oxx o', output an integer in range \$\left[0,6105\right]\$.

Source Link
tsh
  • 36.2k
  • 2
  • 36
  • 133

JavaScript (Node.js), 77 bytes

s=>(i=0,g=(p,c)=>p[8]?i+=c&6?0:p<s:[0,7,1].map(n=>g(p+' xo'[n%5],~~c+n))|i)``

Try it online!

Input string as format 'x oxx o', output an integer in range \$\left[0,6105\right]\$.