Skip to content

Commit

Permalink
Merge pull request #250 from sir-gon/develop
Browse files Browse the repository at this point in the history
[REFACTOR] Some logs fixed
  • Loading branch information
sir-gon authored Dec 13, 2023
2 parents ae506a0 + 2d6b107 commit fd518e7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/projecteuler/problem0006.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function problem0006(_bottom = 1, _top = 100): number {
}`
);

console.log('Problem 0006 result: %i', answer);
console.log(`Problem 0006 result: ${answer}`);
return answer;
}

Expand Down
14 changes: 9 additions & 5 deletions src/projecteuler/problem0018.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ const rootCoordinateI = 0;
const rootCoordinateJ = 0;

export function problem0018(_triangle: number[][]): number {
console.debug('_triangle', _triangle);
console.debug(`_triangle: ${_triangle}`);
console.debug(
'_triangle',
JSON.stringify(BNodeBuilder.buildBNodeTree(_triangle, 0, 0), null, 4)
`_triangle: ${JSON.stringify(
BNodeBuilder.buildBNodeTree(_triangle, 0, 0),
null,
4
)}`
);

const leafs: number[] = [];
Expand All @@ -24,8 +27,9 @@ export function problem0018(_triangle: number[][]): number {
leafs
);

console.debug('_triangle', JSON.stringify(weightsTree, null, 4));
console.debug('leafs count', leafs.length, 'leafs', leafs);
console.debug(`_triangle: ${JSON.stringify(weightsTree, null, 4)}`);
console.debug(`leafs count: ${leafs.length}`);
console.debug(`leafs: ${leafs}`);

const max = leafs.reduce((a, b) => (a > b ? a : b));

Expand Down
2 changes: 1 addition & 1 deletion src/projecteuler/problem0020.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { bigFactorial, bigSumMany } from './helpers';
export function problem0020(_limit: number): string {
const strFactorial = bigFactorial(_limit);

console.log(`Factorial of ${_limit}!:`, strFactorial);
console.log(`Factorial of ${_limit}!: ${strFactorial}`);

const digits = strFactorial.split('');

Expand Down
4 changes: 2 additions & 2 deletions src/projecteuler/problem0021.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export function problem0021(_start: number, _limit: number): string {
}
});

console.log(`result`, properDivisorsOf);
console.log(`amicableNumbers`, amicableNumbers);
console.log(`result: ${properDivisorsOf}`);
console.log(`amicableNumbers: ${amicableNumbers}`);

return bigSumMany(amicableNumbers);
}
Expand Down
2 changes: 1 addition & 1 deletion src/projecteuler/problem0022.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export function problem0022(listOfNames: string[]): number {
result += (i + 1) * wordScore(listOfNames[i]);
}

console.log(`result`, result);
console.log(`result: ${result}`);

return result;
}
Expand Down

0 comments on commit fd518e7

Please sign in to comment.