$ groovy -e "println new BigInteger(args[0]).isProbablePrime(99)" 19
$ true <--- i.e. 19 is prime
I suspect that this will be considered cheating: (a) it evaluates "probable" primes and (b) it isn't in the spirit of the game. But still neat, n'est-ce-pas?
Final Score
JVM Tunnelers 1 Cryptic Scripts 0
I think this divides a clever (writes clver code) from an excellent developer (reuses existing code).
ReplyDeletePeace
-stephan
--
Stephan Schmidt :: stephan@reposita.org
Reposita Open Source - Monitor your software development
http://www.reposita.org
Blog at http://stephan.reposita.org - No signal. No noise.