1 of 3
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 couple 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:

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