NaNoGenMo / 2019

National Novel Generation Month, 2019 edition.
97 stars 5 forks source link

Conway's Novel of Life #10

Open aTylerRobertson opened 4 years ago

aTylerRobertson commented 4 years ago

Hi, all! đź‘‹ Long-time/first-time, etc.

This year, I'd like to make a novel generator using Conway's Game of Life (I searched to see if this has been done already, and I don't think that it has, but please correct me if I'm wrong!).

Concept:

Stretch Goals:

hugovk commented 4 years ago

Sounds promising!

https://github.com/NaNoGenMo/2017/issues/123 used cellular automata, but not Game of Life:

Yes, it’s based on the elementary (1D) automata studied extensively by Wolfram and others.

Game of Life is generally represented in 2D grid space with edge cells in either 4 or 8 directions. I haven’t figured out how to translate this 2D space to a text representation (yet!), but the 1D automata structure has a fairly intuitive mapping to the linear ordering of words in prose/book conventions.

aTylerRobertson commented 4 years ago

I've worked up a "working" interactive version of this idea here:

https://codepen.io/compysando/pen/bGGaEjq

Here's a fun excerpt using a section of "The Strange Case of Dr. Jekyll and Mr. Hyde" as input:

The figure these the all any time he dozed over it but it glide more stealthily through sleeping houses or move more swiftly and the swiftly lamplighted city a child and And the face which he might know even in his it face or that him and melted before his and thus it was apace in the lawyer’s mind strong an curiosity to behold the features on him thought the mystery would perhaps away was the of when He a reason for friend’s preference or (call it you and the will it a face the face of man was bowels mercy: had but to itself raise up in the the a spirit of hatred that Mr Utterson began haunt the door the shops In the office hours at when business was and at night fogged city moon all lights all hours solitude concourse lawyer on “If he be Mr Hyde” he “I shall be Mr Seek” And his was fine night; frost the the streets a the unshaken by any wind a pattern of and shadow o’clock when shops the very in of low of from all round silent Small carried far; domestic sounds houses were clearly on the roadway; approach any him a long time some minutes at his post when he was aware of light footstep

A few issues I've noticed up front:

  1. Longer input texts inherently generate longer sentences with the current rules
  2. Not all runs will generate a 50,000-word output (if the game dies out, etc.)
  3. Punctuation, sentence structure isn't handled dynamically yet

I'll be making another pass at this tomorrow to clean up/document the code so far, then this weekend I'll look into adding a canvas element to display the game as it plays out.

greg-kennedy commented 4 years ago

The tags on this are confusing me :) I see the Interactive version and ran it, but do you want to attach a 50,000 word Sample output and claim your "completed" label?