Compute the vlaue of playing a given word on a given template.