Skip to content

Instantly share code, notes, and snippets.

@benjaminjamesbush
Last active January 7, 2023 08:13
Show Gist options
  • Select an option

  • Save benjaminjamesbush/cc4c70995f8fa45a71771ae8a98d0790 to your computer and use it in GitHub Desktop.

Select an option

Save benjaminjamesbush/cc4c70995f8fa45a71771ae8a98d0790 to your computer and use it in GitHub Desktop.

πŸ‘€ Human πŸ‘€

You will be helping me simulating the evolution of a population of biomorphs, as described by Richard Dawkins in his book, The Blind Watchmaker.

The chat interface we are using to communicate runs in a browser and interprets markdown syntax. As a consequence, you can include an SVG in your response and my browser will render it. You must follow these instructions precisely for the SVG to render successfully:

  • write "![svg](data:image/svg+xml;charset=utf8," and then (without adding a space in between) append the url-encoded svg-code, then append a closing parenthesis.
  • the tag must include the attribute xmlns="http://www.w3.org/2000/svg"
  • do NOT put the svg code inside a code snippet."

The biomorphs you generate will be placed into Markdown tables. Each table will be called a "Generation".

Each Generation will contain 9 biomorphs. The biomorph contained within Generation g will be labled biomorph(g,i) for i from 1 to 9.

Each table you create should follow the following template:

Generation
(g,1) <biomorph(g,1)> (g,2) <biomorph(g,2)> (g,3) <biomorph(g,3)>
(g,4) <biomorph(g,4)> (g,5) <biomorph(g,5)> (g,6) <biomorph(g,6)>
(g,7) <biomorph(g,7)> (g,8) <biomorph(g,8)> (g,9) <biomorph(g,9)>

Replace each instance of <biomorph(g,i)> with a biomorph SVG as described above.

You will begin by creating Generation 1.

To create the next generation, I will first select one of the biomorphs from Generation 1. The selected biomorph will be copied over to Generation 2 and will be known as the parent biomorph of Generation 2. This means that biomorph(2,1) will be a copy of the selected biomorph. The remaining 8 biomorphs for Generation 2 will be called the child biomorphs of Generation 2. The parent biomorph of Generation 2 is also called parent of each child biomorph of Generation 2.

The child biomorphs for Generation 2 will be created by mutating the parent biomorph for Generation 2.

When you are finished creating Generation 1, prompt me to select the parent biomorph for Generation 2.

We will collaborate to create several generations in this way.


πŸ€– ChatGPT πŸ€–

Sure! I can help you create the biomorphs and simulate their evolution.

To begin, let's create the biomorphs for Generation 1. The biomorphs can be represented as simple line drawings, with each line segment corresponding to a gene that can have a value of 0 or 1. A gene with a value of 0 corresponds to a straight line, while a gene with a value of 1 corresponds to a bent line.

Here is an example of a biomorph with a simple "tree-like" structure, encoded as an SVG:

![svg](data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cpath%20d%3D%22M%2050%200%20L%2050%2025%20L%2025%2050%20L%2050%2075%20L%2050%20100%22%20stroke%3D%22black%22%20stroke-width%3D%2210%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%2F%3E%3C%2Fsvg%3E)

You can create biomorphs with different shapes and structures by altering the gene values.

For Generation 1, let's create 9 biomorphs with random gene values. Here is the table for Generation 1:

Generation 1
(1,1) (1,2) ![svg](data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cpath%20d%3D%22M%2050%200%20L%2050%2025%20L%2025%2050%20L%2050%2075%20L%2050%20100%22%20stroke%3D%22black%

πŸ‘€ Human πŸ‘€

Please continue displaying Generation 1.

πŸ€– ChatGPT πŸ€–

Certainly! Here is the rest of Generation 1:

Generation 1
(1,1) (1,2) (1,3)
(1,4) ![svg](data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3
@benjaminjamesbush
Copy link
Author

I'm using drag and drop to upload the images here in the comment section, then putting the links in my markdown file.

(1,1)
download

(1,2)
download

(1,3)
download

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment