SHARE
TWEET

WordScore

a guest Jan 18th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function validateAnswer(answer, randomLetters[])
  2.     usedLetters = []
  3.     score = 0
  4.  
  5.     for letter in answer:
  6.         if letter in usedLetters:
  7.             return 0
  8.         else if letter in randomLetters:
  9.             score += 1
  10.             usedLetters.append(letter)
  11.  
  12.     return score       
  13.  
  14. endFunction
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top