Skip to content

Commit

Permalink
code fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sankeer28 committed Feb 7, 2024
1 parent d45015e commit c56e171
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"workbench.colorCustomizations": {
"minimap.background": "#00000045",
"scrollbar.shadow": "#00000045"
}
}
21 changes: 11 additions & 10 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,17 @@ function generatePDF(numPDFs=1, numPages=5, batchSize=20) {
var numOperands = Math.floor(Math.random() * 4) + 2;
for (var c = 0; c < 3; c++) {
var equation = "";
var operator = ['+', '-', '*', '/'][Math.floor(Math.random() * 4)];
for (var k = 0; k < numOperands; k++) {
equation += Math.floor(Math.random() * 10) + " " + operator + " ";
}
equation = equation.slice(0, -2) + " =";
var answer = eval(equation.slice(0, -2)).toFixed(2);
answers.push(answer);
totalQuestions++;
doc.setFontSize(12);
doc.text(totalQuestions + ") " + equation, 10 + c*70, 20 + j * 12);
var numOperands = Math.floor(Math.random() * 4) + 2;
var operator = ['+', '-', '*', '/'];
for (var k = 0; k < numOperands; k++) {
equation += Math.floor(Math.random() * 10) + " " + operator[Math.floor(Math.random() * 4)] + " ";
}
equation = equation.slice(0, -2) + " =";
var answer = eval(equation.slice(0, -2)).toFixed(2);
answers.push(answer);
totalQuestions++;
doc.setFontSize(12);
doc.text(totalQuestions + ") " + equation, 10 + c*70, 20 + j * 12);
}
}
}
Expand Down

0 comments on commit c56e171

Please sign in to comment.