Functional Programming Prime Pairs
(1 until n) flatMap (i => (1 until i) map (j => (i, j))) filter (pair => isPrime(pair._1 + pair._2))
A functional programming code snippet generates pairs of integers and filters them so the sum of each pair is prime. The joke is a nerdy programming reference, typically shared as a reaction to complex or overly academic code. EN: A functional programming code snippet generates pairs of integers and filters them so the sum of each pair is prime. The joke is a nerdy programming reference, typically shared as a reaction to complex or overly academic code.
- @profunctor_io / 399 2017-11-19
- Type
- image
- Size
- 800×172 · 13.8 KiB
- Mood
- nerdy, absurd
- Language
- en
- Added