import random


def get_jiggled_word_centers(board_words, max_jiggle=0.15):
    """
    Get the randomly-perturbed center of each word. Ok to perturb up to 0.15 away from the geometric center.
    For default max_jiggle=0.15, this translates to the following possibilities for centers for common word lengths:
    4 : xOxx, xxOx
    5 : xxOxx
    6 : xxOxxx, xxxOxx
    7 : xxOxxxx, xxxOxxx, xxxxOxx
    8 : xxxOxxxx, xxxxOxxx
    9 : xxxOxxxxx, xxxxOxxxx, xxxxxOxxx
    10 : xxxOxxxxxx, xxxxOxxxxx, xxxxxOxxxx, xxxxxxOxxx
    """
    jiggled_centers = []
    for word in board_words:
        possible_centers = [idx for idx in range(len(word)) if abs((len(word)-1)/2 - idx)/len(word) <= max_jiggle]
        jiggled_centers.append(random.sample(possible_centers, 1)[0])
    return jiggled_centers