> 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="https://4248423368-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FB4rxgHwR9ezT3zAjBp6b%2Fuploads%2FXivFNDrcxvsYI5uXkGej%2FScreen%20Shot%202023-03-06%20at%2015.38.49.png?alt=media&amp;token=93197677-d413-43ba-9b62-e2a9838af92b" 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 %}
