Code viewer for World: 2D Perlin noise visualizer

function World() 
{ 
	
	this.newRun = function()
	{
		threeworld.init (  "white"  ); 
	};


}


//---- setup -------------------------------------------------------
// Do NOT make a setup function.
// This is done for you in the API. The API setup just creates a canvas.
// Anything else you want to run at the start should go into the following two functions.

let res = 20;
let time = 0;
let cols, rows;
let cc = 30;

function beforesetup()      // Optional 
{
	// Anything you want to run at the start BEFORE the canvas is created 
	
}


function aftersetup()       // Optional
{
	// Anything you want to run at the start AFTER the canvas is created 
	cols = width/res;
	rows = height/res;
	
}

function draw()             
{

    for (let i =0; i<cols; i++)
    {
        for ( let j=0; j<rows; j++)
        {
            let color = noise(i/cc,j/cc,time)*255;
            stroke(color);
            fill(color);
            rect(i*res,j*res,res,res);
        }
    }
    
    time += 0.01;

    console.log(frameRate(),cc)
}