diff --git a/puzzlers/pzzlr-026.html b/puzzlers/pzzlr-026.html new file mode 100644 index 0000000..275a347 --- /dev/null +++ b/puzzlers/pzzlr-026.html @@ -0,0 +1,69 @@ +

A Sad Commentary

+ + + + + + + + + + + + + + + +
Contributed byA. P. Marki
SourceScala repository
First tested with Scala version2.12.9
+
+

What is the result of executing the following code?

+
+$ cat commentary.scala
+object Commentary extends App
+/* This is a long
+ * commentary.
+
+ */
+{
+  println("""This is a long
+commentary.
+
+""")
+}
+$ scalac commentary.scala
+$ scala commentary.scala
+$ cat commentary2.scala
+object Commentary extends App
+/* This is a long \u000acommentary.\u000a\u000a */
+{
+  println("This is a long \u000acommentary.\u000a\u000a")
+}
+$ scalac commentary2.scala
+$ scala commentary2.scala
+
+
    +
  1. Both compile and run, printing "This is a long commentary." with extra blank lines.
  2. +
  3. Both compile and run, but the second prints "This is a long acommentary."
  4. +
  5. The second compiles and runs, but the first does not compile.
  6. +
  7. The first compiles and runs, but the second does not compile.
  8. +
+
+ +