Last active
August 29, 2015 13:58
-
-
Save jeremyheiler/10015006 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USING: kernel math math.functions sequences ; | |
IN: euler1 | |
: euler1 ( x -- y ) | |
iota [ dup [ 3 divisor? ] [ 5 divisor? ] bi or [ drop 0 ] unless ] map-sum ; |
Thanks again!
That's a clever way to solve the problem.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You bet! If you keep posting gists, I'd be glad to review stuff.
The online documentation is a bit easier to search because it has all of the vocabularies loaded, where your local image won't. There are words like apropos, see, about and so on to help explore, but discoverability is admittedly a bit difficult. The docs are great, but it's still hard to narrow things down if you don't know what you're looking for...but that gets easier. Scanning through the "Vocabulary Index" in the help can give you a good idea of the types of stuff that's covered, and also -completing things while paying attention to the stack effect declaration displayed at the bottom of the listener can also be useful. The #concatenative chatroom is also helpful and friendly folks are always willing to review code and offer advice.
http://elasticdog.com/2008/12/beginning-factor-shufflers-and-combinators/#iota 😄
Using numeric ranges can be handy; my first attempt at this problem (from many years ago) looked like: