Page 1 of 2
A Life Worth Living
Posted: Sun Mar 22, 2009 5:08 pm
by Chocoholic
I'm curious how you solved this... Somehow I couldn't be bothered to find the period of all the oscillators and write down the formula. After all it was pretty easy, using Golly and a (slightly modified) goto.py script.
Posted: Sun Mar 22, 2009 8:48 pm
by megabreit
I used Golly too (after some hints in the Challenges forum)... but without any tweaks or scripts. It took ages to stop and forward to reach the right population.

Posted: Tue Mar 31, 2009 9:36 pm
by Isaev

and I used MCell
It was interesting!
Posted: Tue Mar 31, 2009 11:04 pm
by karma-fusebox
the hlife-algorithm took about a second
Golly is your friend
Posted: Tue Jun 09, 2009 12:19 pm
by Hamstaro
10 000 000 000 cycles with hlife in golly - had the solution very quick - and u have also this nice gfx output

Posted: Sun Jul 05, 2009 9:28 am
by xnop
I found the period of the population vs generation (since the population grows linearly, the period could be found).
The period was 13398, and increment of the population per period was 716, though
but hlife did it in second
Posted: Thu Aug 13, 2009 1:46 pm
by sabretooth
xnop wrote:I found the period of the population vs generation (since the population grows linearly, the period could be found).
The period was 13398, and increment of the population per period was 716, though
i also got the same values for the formula. I also worked out using an earlier test that if i started at gen 14158 I could write a program which would stop exactly on 10 bil. Which I did.
Nice and easy here:
Code: Select all
<?php
set_time_limit(0);
$start = 14158; // this start value is chosen because the prog will land ecatle on 10bil with this.
$count = 1554; // this is how many are alive at gen $start (courtesy of golly)
while($start < 10000000000)
{
$start += 13398;
$count += 716;
}
echo $start . " = " . $count;
?>
which neatly output for me 10000000000 = 534408918
Nice challenge, thanks.
sabre
Posted: Thu Aug 13, 2009 5:31 pm
by nighthalk
golly can do it in minutes if your careful with your faster/slower keys, ie you can set how fast it grows on hashlife mode. so just get it to 90ish bil, then 99, then 99.9 ect, when its like 9.9999E10 then just set generation to get the counter back down to a readable int. step the last dozenish on your own (undo only records when you hit pause).
and thank you for not being a count that is also expressed as an exponent or id have to save the result and hope i can count it from the file. hardest part was making sure every exact pixle matched the bmp map. i had "transcription" errors scaling it in paint
Posted: Tue Aug 25, 2009 12:45 pm
by blablaSTX
a png to rle converter helped - took only a few minutes to write...
Here's the code:
Code: Select all
_141_populationOfLifeGeneration_saveFile
|img wI hI w h sample row col board margin|
margin := 100.
img := (PNGReader readStream:(HTTPInterface get:'http://www.hacker.org/challenge/img/life2.png') data readStream) image.
wI := ((img width - 1) // 8).
hI := ((img height - 1) // 8).
w := margin + wI + margin.
h := margin + hI + margin.
board := Life_Board rows:h cols:w.
row := col := 1.
"/ take sample from the middle
1 to:hI do:[:y |
col := 1.
1 to:wI do:[:x |
sample := img colorAtX:((x-1)*8+1+4) y:((y-1)*8+1+4).
(board at:row+margin) at:col+margin put:(sample = Color white ifTrue:[0] ifFalse:[1]).
col := col + 1.
].
row := row + 1.
].
board saveInRLEFormatAs:'file.rle'
no hacker should have trouble reading smalltalk code...
The rest was easy, using golly.
Posted: Thu Aug 27, 2009 2:54 am
by m!nus
OT: wow. i never really looked at smalltalk, but after reading some wikipedia it seems quite smart to me. also very easy to learn
Posted: Thu Aug 27, 2009 3:21 pm
by blablaSTX
yes, smalltalk's syntax was made to read like english, with object, predicate, subject as in:
someObject doSomethingWith: argument.
Once you got used to its (non-C-like) syntax, it reads very easy.
((and it has all those fancy features like closures, reflection, meta-class protocols etc.
seems like a perfect hacker language to me.)
Posted: Thu Aug 27, 2009 10:52 pm
by Gizmore
Did it also with golly.
For the conversion i used JCS (own tool at wechall.net/tools/JCS) to suck the rgb values and put them into a same size bmp with a hex-editor.
The golly gui was insane fast within windows (using hyperspeed button).
But to solve it i needed to do bgolly -i 10000000 -m1000000000000 foo.rle (which took around 2 minutes)
Very nice challenge after all, was fun to mess with the problem

Posted: Mon Feb 01, 2010 7:33 pm
by jonik555
I used Golly too. I have converted png to rle in PHP

.
nice challenge. Very very nice pattern

.
Posted: Mon Jun 27, 2011 6:07 pm
by kalunos
i can tell u a little more about the result that i examined by hand (+golly):
there are 2 periodical activities in this world:
*154 .. the upper thing i called "glider machine"(A), the reflector (B), creating new gliders +(G1)/(G2)
*174 .. the moving "pathbuilder" (C), creating new pathmarks +(P1/2), killing gliders -(G1/2) ...
so i first had to calc 10 billion mod 154 and mod 174 to get the final cycle positions for both cycles.
write down the final state cell counts for all the base figures ...
then get the cycle counter for both (for the dynamic= created - swallowed gliders finally), sum together, finished.
final cells are:
+ 797 for the static content (A+B+C)
+ 14,927,601 moving gliders alive in the final state (by 5)
+ 114,942,529 path markers (by 4 cells each) on the way.
ok if i knew how to pimp golly to go to the final state that fast, i'd been done even faster

...
happy coding!
Posted: Fri Feb 22, 2013 7:43 pm
by fendi
Great pattern!!
