function placeValues(int low, int high, int[] a, int loc){
if(a[loc] == null){
int mid = ((high - low)/2) + low;
a[loc] = mid;
placeValues(mid, high, a, loc+1);
placeValues(low, mid, a, loc+2);
}
}
function createColor(){
for(int i = 0; i<256; i++){
colorArray[i] = "rgb( 0, 0, " + i + ")";
}
for(int j = 0; j<76; j++){
colorArray[256+j] = "rgb( 0, 255, " + (j+180) + ")";
}
locations[0] = 0;
locations[1] = 301;
placeValues(0, 301, locations, 3);
}
function getColor(index){
createColor();
index = index % colorArray.length;
colorArray[locations[index]];
}
Here is my following code. It continues to send out the SyntaxError (shown in title)(the error appears on the first line: function placeValues(~){). The arrays are located in a parent html file that are also coded under javascript.
Could someone help me understand what the SyntaxError means. I origionally thought it was only complaining because my variables are located in a HTML file but apparently the variables are coded under javascript.
Any thoughts?