{"ScriptPreparationCode":"\r\nfunction generateNoise(width, height) {\r\n // Iterate from Top-Left to Bottom-Right\r\n let noise = [];\r\n for (let y = 0; y \u003C height; y\u002B\u002B) {\r\n for (let x = 0; x \u003C width; x\u002B\u002B) {\r\n if (noise[x] == null) noise[x] = [];\r\n noise[x][y] = Math.random();\r\n }\r\n } return noise;\r\n}\r\n\r\n\r\nfunction generateNoiseSingle(width, height) {\r\n // Iterate from Top-Left to Bottom-Right\r\n let noise = [];\r\n for (let y = 0; y \u003C height; y\u002B\u002B) {\r\n for (let x = 0; x \u003C width; x\u002B\u002B) {\r\n noise[xyToSingle(width, x, y)] = Math.random();\r\n }\r\n } return noise;\r\n}\r\n\r\n\r\nfunction xyToSingle(width, x, y) {\r\n return (y * width) \u002B x;\r\n}\r\n","TestCases":[{"Name":"Two Dimensional","Code":"generateNoise(1000, 1000);","IsDeferred":false},{"Name":"One Dimensional","Code":"generateNoiseSingle(1000, 1000);","IsDeferred":false}]}