Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. def genAnd(xs: List[Boolean]): Boolean = {
  2. def acc(x: Int, xs: List[Boolean]): Boolean = {
  3. if (xs.isEmpty) true
  4. else if (xs.head == false) false
  5. else acc(0, xs.tail)
  6. }
  7. acc(0, xs.tail)
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement