+ 3
Create pascal just for(){} looping
how to create pascal just for looping,not the other,please help me,i am less good in the case of mtk
2 Réponses
+ 2
thanksss bruhhh
+ 1
pascal triangle?
here:
var triangle = [0, 1, 0];
function nextTriangle(){
triangle_ = [0];
for(var i=0;i<triangle.length-1;i++){
triangle_.push(triangle[i]+triangle[i+1]);
}
triangle_.push(0);
return triangle_;
}
console.log(triangle);
for(var j=0;j<10;j++){ //change here for more or less coloms
triangle = nextTriangle()
console.log(triangle);
}