marking1/collatz_test2.scala
author Christian Urban <urbanc@in.tum.de>
Sat, 17 Nov 2018 22:39:02 +0000
changeset 210 34f935e13bdd
parent 158 f60e0908f80b
child 212 c86e40fb3b21
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
210
34f935e13bdd updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
     3
assert(collatz_max(10) == (19, 9))
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
210
34f935e13bdd updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
     5
assert(collatz_max(100) == (118, 97))
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
210
34f935e13bdd updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
     7
assert(collatz_max(1000) == (178, 871))
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
210
34f935e13bdd updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
     9
assert(collatz_max(10000) == (261, 6171))
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
210
34f935e13bdd updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    11
assert(collatz_max(100000) == (350, 77031))
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
210
34f935e13bdd updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    13
assert(collatz_max(1000000) == (524, 837799))
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
210
34f935e13bdd updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    15
assert(collatz_max(2) == (1, 2) || collatz_max(2) == (0, 1))
158
f60e0908f80b updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
210
34f935e13bdd updated
Christian Urban <urbanc@in.tum.de>
parents: 158
diff changeset
    17
assert(collatz_max(77000) == (339, 52527))