Advertisement
Siri0n

Таблица умножения

Dec 28th, 2016
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var n = prompt("Please enter radix") - 0;
  2. document.write(
  3.     "<table><tr style='font-weight:bold'>" +
  4.     Array.apply(null, Array(n))
  5.         .map(function(_, i){
  6.             return "<td style='font-weight:bold'>" +
  7.                 Array.apply(null, Array(n))
  8.                 .map(function(_, j){
  9.                     return (i || j) ? ((i || 1)*(j || 1)).toString(n) : "";
  10.                 }).join("</td><td>") + "</td>";
  11.         }).join("</tr><tr>") +
  12.     "</tr></table>"
  13. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement