main_templates2/resit.scala
changeset 477 a4e1f63157d8
parent 476 7550c816187a
child 478 191cd1de93f1
--- a/main_templates2/resit.scala	Sat Nov 04 18:53:37 2023 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-// Resit about Evil Wordle
-//==========================
-
-
-object Resit { 
-
-import io.Source
-import scala.util._
-
-// ADD YOUR CODE BELOW
-//======================
-
-
-//(1)
-def get_wordle_list(url: String) : List[String] = ???
-
-// val secrets = get_wordle_list("https://nms.kcl.ac.uk/christian.urban/wordle.txt")
-// secrets.length // => 12972
-// secrets.filter(_.length != 5) // => Nil
-
-//(2)
-def removeN[A](xs: List[A], elem: A, n: Int) : List[A] = ???
-
-
-// removeN(List(1,2,3,2,1), 3, 1)  // => List(1, 2, 2, 1)
-// removeN(List(1,2,3,2,1), 2, 1)  // => List(1, 3, 2, 1)
-// removeN(List(1,2,3,2,1), 1, 1)  // => List(2, 3, 2, 1)
-// removeN(List(1,2,3,2,1), 0, 2)  // => List(1, 2, 3, 2, 1)
-
-// (3)
-abstract class Tip
-case object Absent extends Tip
-case object Present extends Tip
-case object Correct extends Tip
-
-
-def pool(secret: String, word: String) : List[Char] = ??? 
-
-def aux(secret: List[Char], word: List[Char], pool: List[Char]) : List[Tip] = ???
-
-def score(secret: String, word: String) : List[Tip] = ???
-
-
-// score("chess", "caves") // => List(Correct, Absent, Absent, Present, Correct)
-// score("doses", "slide") // => List(Present, Absent, Absent, Present, Present)
-// score("chess", "swiss") // => List(Absent, Absent, Absent, Correct, Correct)
-// score("chess", "eexss") // => List(Present, Absent, Absent, Correct, Correct)
-
-// (4)
-def eval(t: Tip) : Int = ???
-
-def iscore(secret: String, word: String) : Int = ???
-
-//iscore("chess", "caves") // => 21
-//iscore("chess", "swiss") // => 20
-
-// (5)
-def lowest(secrets: List[String], word: String, current: Int, acc: List[String]) : List[String] = ???
-
-def evil(secrets: List[String], word: String) : List[String] = ???
-
-
-//evil(secrets, "stent").length
-//evil(secrets, "hexes").length
-//evil(secrets, "horse").length
-//evil(secrets, "hoise").length
-//evil(secrets, "house").length
-
-// (6)
-def frequencies(secrets: List[String]) : Map[Char, Double] = ???
-
-// (7)
-def rank(frqs: Map[Char, Double], s: String) : Double = ???
-
-def ranked_evil(secrets: List[String], word: String) : List[String] = ???
-
-
-}