Manuals/calci/Pascal Triangle Fun

From ZCubes Wiki
Revision as of 17: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)
Jump to navigation Jump to search


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);