Skip to content

Commit

Permalink
Merge pull request #7 from andreas-roehler/master
Browse files Browse the repository at this point in the history
#6, chapter01/solution1.6.1.1.scala
  • Loading branch information
winitzki authored Nov 24, 2023
2 parents 4ea8069 + 8bff255 commit 77f6c3e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.log

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
befehle.org
hs_err_pid*
target
.idea
Expand Down
4 changes: 4 additions & 0 deletions chapter01/solution1.6.1.1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def staggeredFactorial(n: Int): Int = (n to 1 by -2).product

// scala> staggeredFactorial(8)
// res7: Int = 384

0 comments on commit 77f6c3e

Please sign in to comment.