Daniel Martin wrote: > Daniel Martin <martin / snowplow.org> writes: > >> Having now changed to that method, (change one letter and recalculate) >> I'm now getting sub-minute times reasonably frequently. I'm still not >> getting anywhere near the times quoted, but I'm going to try some >> other optimizations to see what I can get. > > Indeed: > $ time ruby /cygdrive/c/Temp/sallowsgram2.rb > 30607 > > Daniel Martin's sallowsgram program produced a sentence with eight > 'a's, one 'b', three 'c's, five 'd's, thirty-eight 'e's, eight 'f's, > seven 'g's, ten 'h's, si xteen 'i's, one 'j', one 'k', four 'l's, four > 'm's, twenty-two 'n's, fourteen 'o's, three 'p's, one 'q', thirteen > 'r's, twenty-nine 's's, twenty-five 't's, five 'u's, seven 'v's, eight > 'w's, two 'x's, five 'y's, and one 'z'. > > real 0m7.685s > user 0m7.468s > sys 0m0.046s These numbers don't say much. My algorithm: With srand(1): Time: 19.703s With srand(2): Time: 3.36s With srand(3): Time: 0.781s but of course it looks much better than hours. We will know more tomorrow :) I would be interested in a version without random, but i don't have much time until tomorrow night. cheers Simon