Skip to main content
3 of 3
deleted 10 characters in body
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44

Jelly, 24 20 bytes

O_97ŻdZIb1Ḥ2¦Z;€3Fḟ0 

Try it online!

A dyadic link taking the word as the left argument and the width as the right. Returns a list of integers where:

-2 = L -1 = U 1 = R 2 = D 3 = Select 
Nick Kennedy
  • 21.2k
  • 3
  • 18
  • 44