+ 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

15th Oct 2018, 3:18 PM
Akmal Hikam
Akmal Hikam - avatar
2 Respuestas
+ 2
thanksss bruhhh
16th Oct 2018, 2:03 PM
Akmal Hikam
Akmal Hikam - avatar
+ 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); }
15th Oct 2018, 8:16 PM
Anton Böhler
Anton Böhler - avatar