| author | Christian Urban <christian.urban@kcl.ac.uk> | 
| Fri, 26 Apr 2024 17:36:41 +0100 | |
| changeset 484 | 70c477ad2fd9 | 
| parent 472 | fbff6f601370 | 
| permissions | -rw-r--r-- | 
| 
432
 
87e487ccbd7c
updated wordle testing
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
1  | 
|
| 
 
87e487ccbd7c
updated wordle testing
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
2  | 
|
| 472 | 3  | 
def urbanmain() = {
 | 
4  | 
import M2._  | 
|
5  | 
||
6  | 
import io.Source  | 
|
| 
432
 
87e487ccbd7c
updated wordle testing
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
7  | 
|
| 
 
87e487ccbd7c
updated wordle testing
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
8  | 
|
| 472 | 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")
 | 
|
| 
432
 
87e487ccbd7c
updated wordle testing
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
13  | 
|
| 472 | 14  | 
//val urban_wordle_url = """https://nms.kcl.ac.uk/christian.urban/wordle.txt"""  | 
15  | 
//val urban_secrets = get_wordle_list(urban_wordle_url)  | 
|
| 
432
 
87e487ccbd7c
updated wordle testing
 
Christian Urban <christian.urban@kcl.ac.uk> 
parents:  
diff
changeset
 | 
16  | 
|
| 472 | 17  | 
  assert(frequencies(urban_secrets)('y') == 0.9680234350909651)
 | 
18  | 
  assert(frequencies(urban_secrets)('e') == 0.897286463151403)
 | 
|
19  | 
  assert(frequencies(urban_secrets)('z') == 0.9933086648165279)
 | 
|
20  | 
}  |