Retool Interview Question

Write a function to play a turn in a popular word game.