> For the complete documentation index, see [llms.txt](https://docs.generative.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.generative.xyz/launch-your-generative-art-on-bitcoin/start-a-new-project.md).

# Start a new project

First, clone the [Generative Template](https://github.com/generative-xyz/generative-xyz-template-simple) on Github.  It has everything you need to launch a new generative art collection.

<figure><img src="/files/IdFYekxFW3V35oicbDUT" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Make sure that the following code snippet is in the `<head>` section of your `index.html`.&#x20;
{% endhint %}

The following code snippet contains the `seed` variable and `mathRand()` function, which will be used to create randomness.&#x20;

During development, `mathRand()` generates a random number locally on your computer. Once your code is deployed on-chain, `mathRand()` will use an on-chain `seed` instead of the local `seed`.&#x20;

{% code title="index.html" %}

```javascript
<head>

    ...
    
    <script id="snippet-contract-code" type="text/javascript">
        const tokenIdRand = (Math.floor(Math.random() * 1000000) + 1) * 1000000 + (Math.floor(Math.random() * 100) + 1);
        let tokenData = {
          "tokenId": tokenIdRand,
          "seed": tokenIdRand.toString(),
        };
    </script>
    
    <script id="snippet-random-code" type="text/javascript">
        const urlSeed = new URLSearchParams(window.location.search).get('seed');
        if (urlSeed && urlSeed.length > 0) {
            tokenData.seed = urlSeed;
        }
        
        const seed = tokenData.seed

        function cyrb128($) {
            let _ = 1779033703, u = 3144134277, i = 1013904242, l = 2773480762;
            for (let n = 0, r; n < $.length; n++) _ = u ^ Math.imul(_ ^ (r = $.charCodeAt(n)), 597399067), u = i ^ Math.imul(u ^ r, 2869860233), i = l ^ Math.imul(i ^ r, 951274213), l = _ ^ Math.imul(l ^ r, 2716044179);
            return _ = Math.imul(i ^ _ >>> 18, 597399067), u = Math.imul(l ^ u >>> 22, 2869860233), i = Math.imul(_ ^ i >>> 17, 951274213), l = Math.imul(u ^ l >>> 19, 2716044179), [(_ ^ u ^ i ^ l) >>> 0, (u ^ _) >>> 0, (i ^ _) >>> 0, (l ^ _) >>> 0]
        }

        function sfc32($, _, u, i) {
            return function () {
                u >>>= 0, i >>>= 0;
                var l = ($ >>>= 0) + (_ >>>= 0) | 0;
                return $ = _ ^ _ >>> 9, _ = u + (u << 3) | 0, u = (u = u << 21 | u >>> 11) + (l = l + (i = i + 1 | 0) | 0) | 0, (l >>> 0) / 4294967296
            }
        }
        let mathRand = sfc32(...cyrb128(seed));
    </script>

    ...

</head>
```

{% endcode %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.generative.xyz/launch-your-generative-art-on-bitcoin/start-a-new-project.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
