PHP code example of a1essandro / diamond-and-square

1. Go to this page and download the library: Download a1essandro/diamond-and-square library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

a1essandro / diamond-and-square example snippets


$gen = new DiamondAndSquare();
$gen->setSize(7); //real size equal 2 ^ 7 + 1, i.e. 129
$gen->setPersistence(1.7);
$gen->setMapSeed("1hCaHs5hZ");

$map = $gen->generate();