Edit: See Neil's answer Neil's answer for the fixed/completed version of the above code.
Edit: See Neil's answer for the fixed/completed version of the above code.
Edit: See Neil's answer for the fixed/completed version of the above code.
Edit: See Neil's answer for the fixed/completed version of the above code.
Edit: See Neil's answer for the fixed/completed version of the above code.
The valid bitmasks are the ones that have exactly two consecutive 1 transitions (the first and the last bitbits being considered as consecutive as well):
([a,b,c,d,e,f])=>!f&&a==e&&!(((a>b)+2*(b>c)+4*(c>d)+8*(d>e))%3)
Below is a 53-byte version suggested by Neil in the comments, which works (and fails) equally well:
([a,b,c,d,e,f])=>!f&&a==e&&!((a>b)-(b>c)+(c>d)-(d>e))
The valid bitmasks are the ones that have exactly two consecutive 1 transitions (the first and the last bit being considered as consecutive as well):
([a,b,c,d,e,f])=>!f&&a==e&&!(((a>b)+2*(b>c)+4*(c>d)+8*(d>e))%3)
The valid bitmasks are the ones that have exactly two consecutive 1 transitions (the first and the last bits being considered as consecutive as well):
([a,b,c,d,e,f])=>!f&&a==e&&!(((a>b)+2*(b>c)+4*(c>d)+8*(d>e))%3)
Below is a 53-byte version suggested by Neil in the comments, which works (and fails) equally well:
([a,b,c,d,e,f])=>!f&&a==e&&!((a>b)-(b>c)+(c>d)-(d>e))