Skip to content

Instantly share code, notes, and snippets.

@gbengaoyetade
Last active November 8, 2020 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gbengaoyetade/3c02c905c816cfb4bdfd965f838e0d4b to your computer and use it in GitHub Desktop.
Save gbengaoyetade/3c02c905c816cfb4bdfd965f838e0d4b to your computer and use it in GitHub Desktop.
A multiplication table built for Node.js
function computeMultiplication(size) {
let max= 12;
let multiplier = 1;
let number = 1;
while(max <= 12*size) {
process.stdout.write(`${number} \t`);
number +=multiplier
if(number > max){
max += 12;
number = max / 12;
multiplier = number;
process.stdout.write('\n');
}
}
}
computeMultiplication(12);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment