-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbenchmark.py
37 lines (29 loc) · 1 KB
/
benchmark.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from functions import *
with open("easy.txt", "r") as dictionary:
lines = dictionary.readlines()
# Select only 5 letter words and strip the newline
fiveletterwords = [s.strip() for s in lines]
"""
for word in lines:
if len(word) == 6: # only words with 5 letters + \n
fiveletterwords.append(word.strip())
"""
score = [0 for _ in range(6)]
notguessed = []
for solution in fiveletterwords:
thisroundwords = fiveletterwords
for i in range(7):
if i == 6:
#print("cannot guess", solution)
notguessed.append(solution)
break
apriori = getguess(thisroundwords);
rawinput = wordtest(solution, apriori)
if rawinput == "22222":
# print("guessed ", solution, "in",i)
score[i] += 1
break
if solution == "vesto":
...
thisroundwords = eliminator(thisroundwords,apriori,rawinput)
print("score: ", score, "on: ", len(lines), "not guessed: ",len(notguessed), (notguessed))