Manuals/calci/Pascal Triangle Fun

Revision as of 16:35, 6 August 2020 by Joseph (talk | contribs) (Created page with " ==Pascal Triangle Fun== === Sierpiński triangle == <pre> //with 32 m=32; pt=PASCALTRIANGLE(m).$(x=>x%2) a=pt .map( function (r,i) { var prefix= (REPEATCHAR(" ",(2...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Pascal Triangle Fun

= Sierpiński triangle

//with 32
m=32;
pt=PASCALTRIANGLE(m).$(x=>x%2)
a=pt
	.map(
		function (r,i)
		{
			var prefix= (REPEATCHAR(" ",(2*m-(2*i+1))/2).split(""));
			 return(
				  prefix
		 			.concat(r.join(", ,").split(","))
		 			.concat(prefix)
			)
		}
	);
(a);