# Return to Revisions

3 of 3
added 1 character in body
Pandu
• 712
• 5
• 9

# Python 3, 111 bytes

def f(s):
u,f,r,l,b,d='WGROBY'
for c in s:
if'R'==c:u,f,d,b=b,u,f,d
else:u,l,d,r=l,d,r,u
return'WG'==u+f


Try it online!

There are a few ways I can think to shave off a few bytes, but I'll just leave it like this, since this approach isn't anywhere near competitive anyway. Happy to hear about other tweaks, though!

• -5: Take a boolean array as input, so if'R'==c: can be just if c:
• -1: Or just change if'R'==c: to if'L'<c:
• -1: Change the lettering scheme from WGROBY to ABCDEF so 'WG'==u+f can be 'AC'>u+f
Pandu
• 712
• 5
• 9