main_testing2/wordle_test7.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 10 Nov 2022 09:52:40 +0000
changeset 438 a02e9efd7bc9
parent 434 1eb11d787af7
child 460 f5c0749858fd
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
432
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     1
434
1eb11d787af7 updated import
Christian Urban <christian.urban@kcl.ac.uk>
parents: 432
diff changeset
     2
import M2._
432
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     3
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     4
import io.Source
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     5
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     6
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     7
def urban_get_wordle_list(url: String) : List[String] = {
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     8
  Source.fromFile(url)("ISO-8859-1").getLines().toList
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
     9
}
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    10
val urban_secrets = urban_get_wordle_list("wordle.txt")
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    11
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    12
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    13
//val urban_wordle_url = """https://nms.kcl.ac.uk/christian.urban/wordle.txt"""
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    14
//val urban_secrets = get_wordle_list(urban_wordle_url)
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    15
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    16
/*
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    17
assert(ranked_evil(urban_secrets, "abbey") == List("whizz"))
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    18
assert(ranked_evil(urban_secrets, "afear") == List("buzzy"))
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    19
assert(ranked_evil(urban_secrets, "zincy") == List("jugum"))
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    20
assert(ranked_evil(urban_secrets, "zippy") == List("chuff"))
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    21
*/
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    22
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    23
assert(ranked_evil(urban_secrets, "beats") == List("orlon") ||
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    24
       ranked_evil(urban_secrets, "beats") == List("fuzzy"))
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    25
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    26
assert(ranked_evil(urban_secrets, "vitae") == List("sools", "solos") ||
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    27
       ranked_evil(urban_secrets, "vitae") == List("fuzzy"))
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    28
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    29
assert(ranked_evil(urban_secrets, "bento") == List("assai") ||
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    30
       ranked_evil(urban_secrets, "bento") == List("fuzzy"))
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    31
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    32
assert(ranked_evil(urban_secrets, "belts") == List("anana") ||
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    33
       ranked_evil(urban_secrets, "belts") == List("fuzzy"))
87e487ccbd7c updated wordle testing
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff changeset
    34