https://github.com/oleander/projecteuler-rb
My own solutions in Ruby for project Euler
https://github.com/oleander/projecteuler-rb
Last synced: 4 months ago
JSON representation
My own solutions in Ruby for project Euler
- Host: GitHub
- URL: https://github.com/oleander/projecteuler-rb
- Owner: oleander
- Created: 2011-12-23T01:15:05.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2011-12-30T20:45:31.000Z (over 13 years ago)
- Last Synced: 2025-01-21T14:47:40.174Z (5 months ago)
- Language: Ruby
- Homepage: http://projecteuler.net/
- Size: 109 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Project Euler in Ruby
## Philosophy
Slow(ish) and compact instead of fast and spacey.
## Example of compact code?
Here is my solution to the first assignment.
``` ruby
(0...1000).select {|n| [3, 5].map{|i| n % i}.any?(&:zero?)}.inject(:+)
```1. Slow? Probably.
2. Compact? Yes, sort of.
3. Readable? Nope.