diff options
Diffstat (limited to 'test/files/run/Course-2002-01.scala')
-rw-r--r-- | test/files/run/Course-2002-01.scala | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/test/files/run/Course-2002-01.scala b/test/files/run/Course-2002-01.scala index 1e97cf0886..b31d1016fd 100644 --- a/test/files/run/Course-2002-01.scala +++ b/test/files/run/Course-2002-01.scala @@ -7,9 +7,9 @@ object M0 { //########################################################################## - java.lang.System.out.println(87 + 145); - java.lang.System.out.println(1000 - 333); - java.lang.System.out.println(5 + 2 * 3); + Console.println(87 + 145); + Console.println(1000 - 333); + Console.println(5 + 2 * 3); //########################################################################## @@ -18,24 +18,24 @@ object M0 { def radius = 10; def circumference = 2 * pi * radius; - java.lang.System.out.println(5 * size); - java.lang.System.out.println(2 * pi * radius); - java.lang.System.out.println(circumference); - java.lang.System.out.println((2 * pi) * radius); + Console.println(5 * size); + Console.println(2 * pi * radius); + Console.println(circumference); + Console.println((2 * pi) * radius); //########################################################################## def square(x: Double) = x * x; - java.lang.System.out.println(square(2)); - java.lang.System.out.println(square(5 + 4)); - java.lang.System.out.println(square(square(4))); + Console.println(square(2)); + Console.println(square(5 + 4)); + Console.println(square(square(4))); //########################################################################## def sumOfSquares(x: Double, y: Double) = square(x) + square(y); - java.lang.System.out.println(sumOfSquares(3, 2+2)); + Console.println(sumOfSquares(3, 2+2)); //########################################################################## @@ -43,17 +43,17 @@ object M0 { def first(x: Int, y: Int) = x; def constOne(x: Int, y: => Int) = 1; - java.lang.System.out.println(constOne(1, loop)); + Console.println(constOne(1, loop)); //########################################################################## def abs(x: Double) = if (x >= 0) x else -x; - java.lang.System.out.println(abs(737)); - java.lang.System.out.println(abs(1)); - java.lang.System.out.println(abs(0)); - java.lang.System.out.println(abs(-1)); - java.lang.System.out.println(abs(-76)); + Console.println(abs(737)); + Console.println(abs(1)); + Console.println(abs(0)); + Console.println(abs(-1)); + Console.println(abs(-76)); //########################################################################## @@ -69,9 +69,9 @@ object M0 { def sqrt0(x: Double) = sqrtIter0(1.0, x); - java.lang.System.out.println(sqrt0(2)); - java.lang.System.out.println(sqrt0(3)); - java.lang.System.out.println(sqrt0(4)); + Console.println(sqrt0(2)); + Console.println(sqrt0(3)); + Console.println(sqrt0(4)); //########################################################################## @@ -89,9 +89,9 @@ object M0 { sqrtIter1(1.0, x) } - java.lang.System.out.println(sqrt1(2)); - java.lang.System.out.println(sqrt1(3)); - java.lang.System.out.println(sqrt1(4)); + Console.println(sqrt1(2)); + Console.println(sqrt1(3)); + Console.println(sqrt1(4)); //########################################################################## @@ -109,9 +109,9 @@ object M0 { sqrtIter2(1.0) } - java.lang.System.out.println(sqrt2(2)); - java.lang.System.out.println(sqrt2(3)); - java.lang.System.out.println(sqrt2(4)); + Console.println(sqrt2(2)); + Console.println(sqrt2(3)); + Console.println(sqrt2(4)); //########################################################################## } @@ -134,7 +134,7 @@ object M1 { sqrtIter(1.0, improve(1.0)) } - java.lang.System.out.println("sqrt(2) = " + sqrt(2)); + Console.println("sqrt(2) = " + sqrt(2)); } //############################################################################ @@ -156,7 +156,7 @@ object M2 { sqrtIter(1.0) } - java.lang.System.out.println("sqrt(2) = " + sqrt(2)); + Console.println("sqrt(2) = " + sqrt(2)); } //############################################################################ @@ -178,7 +178,7 @@ object M3 { cbrtIter(1.0) } - java.lang.System.out.println("cbrt(2) = " + cbrt(2)); + Console.println("cbrt(2) = " + cbrt(2)); } //############################################################################ @@ -188,40 +188,40 @@ object M4 { if (c <= 0 || c >= l) 1 else pascal(c - 1, l - 1) + pascal(c, l - 1); - java.lang.System.out.print(pascal(0,0)); - java.lang.System.out.println(); - - java.lang.System.out.print(pascal(0,1)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(1,1)); - java.lang.System.out.println(); - - java.lang.System.out.print(pascal(0,2)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(1,2)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(2,2)); - java.lang.System.out.println(); - - java.lang.System.out.print(pascal(0,3)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(1,3)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(2,3)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(3,3)); - java.lang.System.out.println(); - - java.lang.System.out.print(pascal(0,4)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(1,4)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(2,4)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(3,4)); - java.lang.System.out.print(' '); - java.lang.System.out.print(pascal(4,4)); - java.lang.System.out.println(); + Console.print(pascal(0,0)); + Console.println; + + Console.print(pascal(0,1)); + Console.print(' '); + Console.print(pascal(1,1)); + Console.println; + + Console.print(pascal(0,2)); + Console.print(' '); + Console.print(pascal(1,2)); + Console.print(' '); + Console.print(pascal(2,2)); + Console.println; + + Console.print(pascal(0,3)); + Console.print(' '); + Console.print(pascal(1,3)); + Console.print(' '); + Console.print(pascal(2,3)); + Console.print(' '); + Console.print(pascal(3,3)); + Console.println; + + Console.print(pascal(0,4)); + Console.print(' '); + Console.print(pascal(1,4)); + Console.print(' '); + Console.print(pascal(2,4)); + Console.print(' '); + Console.print(pascal(3,4)); + Console.print(' '); + Console.print(pascal(4,4)); + Console.println; } //############################################################################ |