We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fe06408 commit a352db3Copy full SHA for a352db3
for-loop-messing.scala
@@ -0,0 +1,7 @@
1
+object ForLoopPlaying {
2
+ def main(args:Array[String]) = {
3
+ for (string <- args
4
+ if string.length > 3;
5
+ if string.length < 5) println(string)
6
+ }
7
+}
pattern-matching.scala
@@ -0,0 +1,8 @@
+import scala.util.Random
+
+val randomNum = new Random() nextInt 10
+randomNum match {
+ case 7 => println("lucky 7!")
+ case anythingElse => println(anythingElse + " is a terrible number!")
8
0 commit comments