Skip to content

Commit

Permalink
add one solution
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei.winitzki committed Nov 22, 2023
1 parent e768cbc commit d250a8b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
13 changes: 0 additions & 13 deletions chapter01/src/test/scala/sofp/unit/Exercise1.1.scala

This file was deleted.

17 changes: 17 additions & 0 deletions chapter01/src/test/scala/sofp/unit/Exercises_1_6_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package sofp.unit

import com.eed3si9n.expecty.Expecty.expect

import munit.FunSuite

class Exercises_1_6_1 extends FunSuite {

test("exercise 1.6.1.1") {

def staggeredFactorial(n: Int): Int = (n to 1 by -2).product

expect(staggeredFactorial(8) == 384)
expect(staggeredFactorial(9) == 945)
}

}

0 comments on commit d250a8b

Please sign in to comment.