main_testing2/wordle_test5.scala
changeset 475 59e005dcf163
parent 437 d4d4669ad054
equal deleted inserted replaced
474:b528d1d3d3c3 475:59e005dcf163
     1 
     1 
     2 import M2._
     2 def urbanmain() = {
     3 import io.Source
     3   import M2._
       
     4   import io.Source
     4 
     5 
     5 
     6 
     6 def urban_get_wordle_list(url: String) : List[String] = {
     7   def urban_get_wordle_list(url: String) : List[String] = {
     7   Source.fromFile(url)("ISO-8859-1").getLines().toList
     8     Source.fromFile(url)("ISO-8859-1").getLines().toList
     8 }
     9   }
     9 val urban_secrets = urban_get_wordle_list("wordle.txt")
    10   val urban_secrets = urban_get_wordle_list("wordle.txt")
    10 
    11 
    11 //val urban_wordle_url = """https://nms.kcl.ac.uk/christian.urban/wordle.txt"""
    12   //val urban_wordle_url = """https://nms.kcl.ac.uk/christian.urban/wordle.txt"""
    12 //val urban_secrets = get_wordle_list(urban_wordle_url)
    13   //val urban_secrets = get_wordle_list(urban_wordle_url)
    13 
    14 
    14 
    15 
    15 assert(evil(urban_secrets, "stent").length == 1907)
    16   assert(evil(urban_secrets, "stent").length == 1907)
    16 assert(evil(urban_secrets, "hexes").length == 2966)
    17   assert(evil(urban_secrets, "hexes").length == 2966)
    17 assert(evil(urban_secrets, "horse").length == 1203)
    18   assert(evil(urban_secrets, "horse").length == 1203)
    18 assert(evil(urban_secrets, "hoise").length == 971)
    19   assert(evil(urban_secrets, "hoise").length == 971)
    19 assert(evil(urban_secrets, "house").length == 1228)
    20   assert(evil(urban_secrets, "house").length == 1228)
    20 
    21 }