feat(scala): m01–m06 port with shared fixtures

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Sonnet 5.5 committed 2026-10-29 00:07:27 +01:00
1 parent 045029639e
commit 1e186733d1
23 files changed
+771 -2

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
package snake
/** m01 util: small helpers used by every later module. */
object Util:
def range(n: Int): List[Int] = List.range(0, n)
def dropLast[A](xs: List[A]): List[A] = xs.dropRight(1)
def contains[A](xs: List[A], p: A, eq: (A, A) => Boolean): Boolean = xs.exists(x => eq(x, p))