diff options
| author | Zach DeCook <zachdecook@librem.one> | 2021-12-01 01:12:35 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2021-12-01 01:12:35 -0500 |
| commit | b2eed7eee4f4730b458bfd3bac285363dd15b938 (patch) | |
| tree | 6ca5e436344428623a723d0d389184341da8c5cb /mapScore.py | |
| parent | 85c03d4d69f6a004e3d166680c6163147fb34470 (diff) | |
| download | swipeGuess-b2eed7eee4f4730b458bfd3bac285363dd15b938.tar.gz | |
map scoring: weight length of word
Diffstat (limited to 'mapScore.py')
| -rwxr-xr-x | mapScore.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mapScore.py b/mapScore.py index 61a5259..154142f 100755 --- a/mapScore.py +++ b/mapScore.py @@ -21,9 +21,10 @@ def scoreWord(word,mm): pc=word[0] or ' ' s=0 for c in word: - #manhattan dist - s+=abs(mm[ord(pc)][0]-mm[ord(c)][0]) - s+=abs(mm[ord(pc)][1]-mm[ord(c)][1]) + #manhattan dist * 10 + s+=abs(mm[ord(pc)][0]-mm[ord(c)][0])*10 + s+=abs(mm[ord(pc)][1]-mm[ord(c)][1])*10 + s+=1 # longer word bias pc=c return s |
