author | Christian Urban <christian.urban@kcl.ac.uk> |
Thu, 06 Jun 2024 22:18:15 +0100 | |
changeset 490 | 4778fefecd0c |
parent 475 | 59e005dcf163 |
permissions | -rw-r--r-- |
435
fda7c39f3b6a
updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
1 |
|
fda7c39f3b6a
updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
|
475 | 3 |
def urbanmain() = { |
4 |
import M2._ |
|
5 |
||
6 |
import io.Source |
|
7 |
||
8 |
||
9 |
def urban_get_wordle_list(url: String) : List[String] = { |
|
10 |
Source.fromFile(url)("ISO-8859-1").getLines().toList |
|
11 |
} |
|
12 |
val urban_secrets = urban_get_wordle_list("wordle.txt") |
|
435
fda7c39f3b6a
updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
13 |
|
fda7c39f3b6a
updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
14 |
|
475 | 15 |
//val urban_wordle_url = """https://nms.kcl.ac.uk/christian.urban/wordle.txt""" |
16 |
//val urban_secrets = get_wordle_list(urban_wordle_url) |
|
435
fda7c39f3b6a
updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
17 |
|
475 | 18 |
assert(ranked_evil(urban_secrets, "abbey") == List("whizz")) |
19 |
assert(ranked_evil(urban_secrets, "afear") == List("buzzy")) |
|
20 |
assert(ranked_evil(urban_secrets, "zincy") == List("jugum")) |
|
21 |
assert(ranked_evil(urban_secrets, "zippy") == List("chuff")) |
|
435
fda7c39f3b6a
updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
22 |
|
fda7c39f3b6a
updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
23 |
|
475 | 24 |
assert(ranked_evil(urban_secrets, "beats") == List("fuzzy")) |
25 |
assert(ranked_evil(urban_secrets, "vitae") == List("fuzzy")) |
|
26 |
assert(ranked_evil(urban_secrets, "bento") == List("fuzzy")) |
|
27 |
assert(ranked_evil(urban_secrets, "belts") == List("fuzzy")) |
|
28 |
} |