/** * hash-and-star.js * */ import {terminal} from "./dfhi.js"; window.main = function(...argv) { let n = Number.parseInt(argv[0]); let stars = ''; // Code to create table (with tr and td.... let space = ''; let star = ''; // a table with n lines for(let line = 0; line < n; ++line) { stars += ''; // each line has n/2 stars and n/spaces for(let col = 0; col < n; ++ col){ if (col % 2 == 0) { stars += star; }else { stars += space; } } stars += ''; } stars += '
*
'; terminal.printh(stars); };