Now in general format

Now in general format.

Previous Thread This week's challenge: Conway's Game of Life

Your goal is to create a Conway's Game of Life simulator using the language of your choice. The basic rules are as follows:

The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, live or dead. Every cell interacts with its eight neighbours, which are the cells that are directly horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:

> Any live cell with fewer than two live neighbours dies, (underpopulation).
> Any live cell with two or three live neighbours lives on to the next generation.
> Any live cell with more than three live neighbours dies (overpopulation).
> Any dead cell with exactly three live neighbours becomes a live cell (reproduction).

The initial pattern is the seed. The rules are then applied to every single cell in the seed simultaneously. The rules continue to be applied to create further generations.

Post results / bits of code

Tips:
>If you find the task too simple, you're encouraged to try different variations and figure out ways to make the problem more challenging.
>These threads are still in their early stages, if you have any ideas for how these threads should work in the future or for new challenges, feel free to contribute in this thread

Other urls found in this thread:

github.com/AUTOMATIC1111/randdraw
i.4cdn.org/g/1507902209932.jpg
twitter.com/NSFWRedditImage

I'm sure I have a QuickBasic implementation somewhere. It's from 2000 or something. I was 17 then and a complete n00b, so not gonna post it.

So while this is up, I'll post my C++ implementation of the first weekly challenge.

Painting 3-9 pixels squares, and a million iterations takes 5 seconds.

Great. Forgot the picture.

Actually, I think something's broken. Fug.

All right. All better now. rand() only returned numbers to 0x7fff so it could only access some of the colors when paining.

Here's my code.

github.com/AUTOMATIC1111/randdraw

Pic created with 10 million optimizations, 31 seconds.

Please don't die on me.

Try creating these threads whenever the muricans are awake.

you've forgot topic name

get gud

...

Here's another. That's 10 million iterations. Posting as jpg because png would be too large.

...

has anyone tried getting the colors from a different image?

you get some interesting results

What do you mean by colors from a different image?

This works only by choosing a random color from the _original_ image, otherwise it would not converge, i guess

Can you post the original?

It's in the thread before previous. The image should still be accessible, I think: i.4cdn.org/g/1507902209932.jpg

no you don't need to use the colors from the original image, you can use random colors of colors from another image,

Question: when people are saying 'iterations', do you mean successful color guesses, both successful and unsuccessful ones?

successful and unsuccessful

retard question, is there a library already in the standard c/c++ libraries that can produce graphical outputs? how difficult is it to write your own? should i just use SDL?

using colors from the cga palette image

this is completely random colors, 10M iterations

non-random colors, larger lines, 10M

nice.

...

That's very interesting. Here's 10M for me.

The grey background looks extremely nice on yours, but the girl, and light parts look like there has been very little attention put to them, compared to mine, where the reverse is true.

I wonder if this is because in my program each color used in original picture has an equal chance to be used, and in yours you just pick a pixel at random from original picture and use its color, so colors that are more used have more chances of appearing.

makes sense.
yes i choose a completely random color from source, they are not unique

using costanza colors

more iterations makes it a little better, 20M

50M

250m

UP

I'm bored, give me some ideas what to write

Only drawing diagonal lines, ~30s for 10M tries on an i7, 1m 50s on my shitty chromebook with an 1.8 GHz ARM CPU. No progress output, otherwise it would be much much slower.

write a program that redraws the source image with the colors from a 2nd image pixel by pixel, without drawing shapes/lines

see

...