core_testing1/collatz_test2.scala
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 23 Feb 2024 11:31:36 +0000
changeset 483 1a51207780e6
parent 472 6a77c260c8a5
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
472
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
     1
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
     2
def urbanmain() = {
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
     3
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
     4
  import C1._
125
dcaab8068baa updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
472
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
     6
  assert(collatz_max(10) == (19, 9))
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
     7
  assert(collatz_max(100) == (118, 97))
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
     8
  assert(collatz_max(1000) == (178, 871))
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
     9
  assert(collatz_max(10000) == (261, 6171))
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
    10
  assert(collatz_max(100000) == (350, 77031))
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
    11
  assert(collatz_max(1000000) == (524, 837799))
6a77c260c8a5 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 399
diff changeset
    12
}