Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conway's Novel of Life #10

Open
aTylerRobertson opened this issue Oct 14, 2019 · 3 comments
Open

Conway's Novel of Life #10

aTylerRobertson opened this issue Oct 14, 2019 · 3 comments
Labels

Comments

@aTylerRobertson
Copy link

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:

  • Accept input text of whatever length
  • Split the text into an array that gives us a "grid" of appropriate length/width
  • Overlay that array with Conway's Game of Life
  • Each generation, read the grid from left-to-right and top-to-bottom, adding the word under each active cell to the output, creating a sentence
  • Repeat the above until word count is over 50,000

Stretch Goals:

  • Add a visualiser to let the user watch the program write
  • Allow user to select from a number of popular Conway patterns
@hugovk
Copy link
Member

hugovk commented Oct 14, 2019

Sounds promising!

NaNoGenMo/2017#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
Copy link
Author

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
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants