aquí mi ejercicio
<meta charset = "UTF8">
<h1>Programa V.4</h1>
<br>
<br>
<br>
<canvas width = "600" height = "400"> </canvas>
<script>
var pantalla = document.querySelector("canvas");
var pincel = pantalla.getContext("2d");
pincel.fillStyle = " #eaecee ";
pincel.fillRect(0, 0, 600, 400);
function designcircle(x,y,ratio){
var posicion = Math.round(Math.random() * 10);
var color = [" #cd6479 "," #cd64aa "," #b964cd "," #8764cd ","#6497cd"," #64cdc2 ","#6ecd64"," #f1f174 ","#ea6161"," #ffffff "," #000000 "]
pincel.fillStyle = color[posicion];
pincel.beginPath();
pincel.arc(x,y,ratio,0,2*Math.PI);
pincel.fill();
}
var x = 0;
var sentido = 1
function limpiar(){
pincel.clearRect(0, 0, 600, 400);
}
function updatescreen() {
limpiar();
setInterval(designcircle(x,20,10),2500);
if(x > 600){
sentido = -1;
}
else if(x < 0){
sentido = 1;
}
x = x + sentido;
}
setInterval(updatescreen,5);
</script>