Skip to content

Commit

Permalink
Fix: Text on the whole line with ez80 models
Browse files Browse the repository at this point in the history
  • Loading branch information
Wistaro committed Jun 10, 2017
1 parent 85f6fdf commit 0b06db4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions generator.js
Expand Up @@ -54,7 +54,7 @@ function generateCourse()

const MIN_PAS_X = 0;
const MIN_PAS_Y = (chosenCalc === "83PCE") ? 12 : 7;
const MAX_CHAR_LINE = (chosenCalc === "83PCE") ? 33 : 23;
const MAX_CHAR_LINE = (chosenCalc === "83PCE") ? 36 : 23;
const LAST_LINE = (chosenCalc === "83PCE") ? 13 : 9;

let newCourse = ((chosenCalc === "83PCE") ? "12→W\n" : "7→W\n") + courseInit + courseHeader;
Expand All @@ -71,7 +71,7 @@ function generateCourse()

inputStr = inputStr.replace(/"/g, "''") // replacing " by ''
.replace(//g, "->") // replacing arrow
.replace(/ /g, " "); // 2 spaces look better on screen
//.replace(/ /g, " "); // 2 spaces look better on screen

const splitInput = inputStr.split('\n');

Expand Down Expand Up @@ -109,9 +109,11 @@ function generateCourse()

let currentSubStr = "";

alert(MAX_CHAR_LINE);

for (var i = 0; i < inputStr.length; i++)
{
if ((i % MAX_CHAR_LINE) === 0)
if (!(i % MAX_CHAR_LINE))
{
currentSubStr = inputStr.substring(i, i + MAX_CHAR_LINE);

Expand Down

0 comments on commit 0b06db4

Please sign in to comment.