Can anyone explain why this code isn't functioning correctly? Although it prints "generating fish," nothing is being printed after that.
function fish(x, y, degree, genes, Snumber) {
this.x = x;
this.y = y;
this.dgree = degree;
this.energy = 50;
this.genes = genes;
this.Snumber = Snumber;
}
var fishs = new Array(10);
var Snumber = 0;
document.writeln("Generating fish");
for (i = 0; i < 10; i++) {
var x = Math.round(Math.random * 600);
var y = Math.round(Math.random * 600);
var degree = Math.round(Math.random * 360);
var genes = new Array(12);
for (j = 0; j < 12; j++) {
genes[j] = Math.random * 2 - 1;
}
fishs[i] = new fish(x, y, degree, genes, Snumber);
Snumber++;
document.writeln("Generating fish number " + i);
}