-
Notifications
You must be signed in to change notification settings - Fork 0
/
wordle.cpp
45 lines (32 loc) · 929 Bytes
/
wordle.cpp
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
38
39
40
41
42
43
44
#include "Util.hpp"
#include "Evaluator.hpp"
#include <random>
size_t play ( string const& wins_file = "./shuffled_real_wordles.txt",
string const& gses_file = "./official_allowed_guesses.txt")
{
WordleEngine we(wins_file, gses_file);
we.Play(cin, cout);
return 0;
}
size_t find_two_words()
{
string const wins_file = "./shuffled_real_wordles.txt";
string const gses_file = "./official_allowed_guesses.txt";
Evaluator eval(wins_file, gses_file);
score_table_t scores;
eval.score_candidates2(scores);
auto it = scores.begin();
for ( size_t i = 0 ; i < 1000 ; ++i, ++it )
cout << it->first << " " << it->second << endl;
return scores.size();
}
int main ( int argc, char *argv[])
{
string const SELF (argv[0]);
int ret = 0;
if ( argc > 1 && !strcmp(argv[1], "play") )
ret = play();
if ( argc > 1 && !strcmp(argv[1], "two") )
ret = find_two_words();
return 0;
}