Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[0..]

Name: Anonymous 2011-04-05 22:27

I've been watching my terminal for an hour now. I still haven't found infinity.

Name: Anonymous 2011-04-05 22:39

findInfinity :: [Integer] -> Integer
findInfinity [] = error "could not find infinity"
findInfinity [x] = x
findInfinity (x1:x2:xs) = if x1 == x2
  then x1  -- numbers stopped increasing, it must be infinity
  else findInfinity (x2:xs)

findInfinity [0..]

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List