main_testing2/wordle_test6.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 23 Dec 2022 16:52:34 +0000
changeset 456 d076cb2e0b75
parent 437 d4d4669ad054
child 475 59e005dcf163
permissions -rw-r--r--
updated jars


import M2._

import io.Source


def urban_get_wordle_list(url: String) : List[String] = {
  Source.fromFile(url)("ISO-8859-1").getLines().toList
}
val urban_secrets = urban_get_wordle_list("wordle.txt")

//val urban_wordle_url = """https://nms.kcl.ac.uk/christian.urban/wordle.txt"""
//val urban_secrets = get_wordle_list(urban_wordle_url)

assert(frequencies(urban_secrets)('y') == 0.9680234350909651)
assert(frequencies(urban_secrets)('e') == 0.897286463151403)
assert(frequencies(urban_secrets)('z') == 0.9933086648165279)