{"ScriptPreparationCode":"$N = 800;\r\n\r\n$c = document.getElementById(\u0027c\u0027);\r\n$ctx = c.getContext(\u00272d\u0027);\r\n\r\n$ctx.clearRect(0, 0, $N, 1);\r\n$pxls = [];\r\nfor (let i = 0; i \u003C $N; \u002B\u002Bi) {\r\n $pxls.push({\r\n r: Math.random() * 255 \u003C\u003C 0,\r\n g: Math.random() * 255 \u003C\u003C 0,\r\n b: Math.random() * 255 \u003C\u003C 0\r\n });\r\n}","TestCases":[{"Name":"FillRect","Code":"for (let i = 0; i \u003C $N; i\u002B\u002B) {\r\n let px = $pxls[i];\r\n $ctx.fillStyle = \u0027rgb(\u0027 \u002B px.r \u002B \u0027,\u0027 \u002B px.g \u002B \u0027,\u0027 \u002B px.b \u002B \u0027)\u0027;\r\n $ctx.fillRect(i, 0, 1, 1);\r\n}","IsDeferred":false},{"Name":"PutImageData","Code":"const imageData = $ctx.createImageData($N, 1);\r\nconst data = imageData.data;\r\nfor (let i = 0; i \u003C $N; i\u002B\u002B) {\r\n let px = $pxls[i];\r\n data[i * 4 \u002B 0] = px.r;\r\n data[i * 4 \u002B 1] = px.g;\r\n data[i * 4 \u002B 2] = px.b;\r\n data[i * 4 \u002B 3] = 255;\r\n}\r\n$ctx.putImageData(imageData, 0, 0);","IsDeferred":false}]}