Last active
February 29, 2016 09:53
-
-
Save heathermiller/cef6289a2fbf16f43c8d to your computer and use it in GitHub Desktop.
Scala Fiddle error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
^ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
All I did was add the
val hi = "Hi"
line and press Run.