Pages

rotation de matrice !

code


const t = [

  [0,1,0],

  [1,1,1],

  ]


const rev = t => t[0].map( (_,i) =>  t.map( r => r[i]).reverse());


  

const aff = t => {

  const text = t

    .map(row => [...row].join(" "))

    .join("\n");

  return text;

};


console.log(aff(rev(t)))