Skip to content

Instantly share code, notes, and snippets.

@heathermiller
Last active February 29, 2016 09:53
Show Gist options
  • Save heathermiller/cef6289a2fbf16f43c8d to your computer and use it in GitHub Desktop.
Save heathermiller/cef6289a2fbf16f43c8d to your computer and use it in GitHub Desktop.
Scala Fiddle error
ScalaFiddle.scala:13: error: constructor cannot be instantiated to expected type;
found : (T1, T2)
required: String
else for (((color, func), i) <- graphs) {
^
ScalaFiddle.scala:14: error: Any does not take parameters
val y = func(x/w * 75) * h/40 + h/count * (i+0.5)
^
ScalaFiddle.scala:14: error: type mismatch;
found : Double(0.5)
required: String
val y = func(x/w * 75) * h/40 + h/count * (i+0.5)
^
ScalaFiddle.scala:15: error: type mismatch;
found : scala.Any
required: scala.scalajs.js.Any
Page.renderer.fillStyle = color
^
val graphs = Seq[(String, Double => Double)](
("red", sin),
("green", x => 2 - abs(x % 8 - 4)),
("blue", x => 3 * pow(sin(x / 12), 2) * sin(x))
)
val hi = "Hi"
@heathermiller
Copy link
Author

All I did was add the val hi = "Hi" line and press Run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment