A more concise version[1]:
2 1000 ^ number>digits sum
cheers
[1] http://docs.factorcode.org/content/word-euler016%2Cproject-euler.016.html
2013/1/16 Leonard P :
> Feels nice when you get the hang of it.
>
> http://projecteuler.net/problem=16
>
> 2 1000 (pow) number>string 1 group [ string>numbe
On Wed, Jan 16, 2013 at 3:44 AM, Alfredo Beaumont <
alfredo.beaum...@gmail.com> wrote:
> A more concise version[1]:
>
> 2 1000 ^ number>digits sum
>
> cheers
>
Awesome.
Seems like Factor would be a great tool for teaching math.
Anyone get the graphviz gallery to work?
--
>
> Anyone get the graphviz gallery to work?
>
Er, nm... works now.
--
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of
On Thu, Jan 10, 2013 at 11:44 AM, Alex Vondrak wrote:
> Haven't looked at the code, but to answer your question about
> `for`-loops...
>
> "for each" loops:
> http://docs.factorcode.org/content/word-each,sequences.html
> "for i = 0 up to n" loops: use `each` with
> http://docs.factorcode.org/cont
>
> Was wondering if there could be a variation of "for i = 0 up to n", when n
> is unknown.
>
> Named it "index-pump".
>
> Instead of "looping over a body of code", we are "index-pumping a
> function".
>
> : index-pump ( quot -- m )
> 1 swap [ dup ] prepose [ 1 + ] while ; inline
>
Er, seems
Ok list. I've done enough wrangling. It's time for me to sit back, let
the language sink in, and read some code examples. Apologies if I've
overtaxed your inbox. For someone used to Java, Factor takes some getting
used to, but it is an exciting paradigm. My hope for Factor is that its
librarie