Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/day22' into day22
Browse files Browse the repository at this point in the history
  • Loading branch information
dubzzz authored Dec 22, 2024
2 parents 77a0fd0 + 1b7e335 commit 29dc27f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { buildAdventOfTheDay } from '../2024-12-01-advent-of-pbt-day-1/AdventOfT
const { AdventPlaygroundOfTheDay, FormOfTheDay } = buildAdventOfTheDay({
day: 22,
buildBuggyAdvent: adventBuggy,
referenceAdvent: findOptimalPacking,
referenceAdvent: computeSantaMindScore,
parser,
placeholderForm: '🎄🎁⛄🎈🎅\n🎁🎄⛄🎄🦌',
functionName: 'findOptimalPacking',
signature: 'findOptimalPacking(weights: number[]): number[][];',
functionName: 'computeSantaMindScore',
signature: 'findOptimalPacking(secretSequence: Sequence, guessedSequence: Sequence): { goodPlacement: number; misplaced: number };',
signatureExtras: [
"type Icon = '🎄' | '🦌' | '⛄' | '🛷' | '🎈' | '🎀' | '🎅' | '🎁';",
'type Sequence = [Icon, Icon, Icon, Icon, Icon];',
Expand All @@ -22,7 +22,7 @@ export { AdventPlaygroundOfTheDay, FormOfTheDay };
type Icon = '🎄' | '🦌' | '⛄' | '🛷' | '🎈' | '🎀' | '🎅' | '🎁';
type Sequence = [Icon, Icon, Icon, Icon, Icon];

function findOptimalPacking(
function computeSantaMindScore(
secretSequence: Sequence,
guessedSequence: Sequence,
): { goodPlacement: number; misplaced: number } {
Expand Down
2 changes: 1 addition & 1 deletion website/blog/2024-12-22-advent-of-pbt-day-22/buggy.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function advent() {
* @param {Sequence} guessedSequence
* @returns {{goodPlacement:number; misplaced: number}}
*/
return function findOptimalPacking(secretSequence, guessedSequence) {
return function computeSantaMindScore(secretSequence, guessedSequence) {
let goodPlacement = 0;
let misplaced = 0;
const copiedSecretSequence = [...secretSequence];
Expand Down

0 comments on commit 29dc27f

Please sign in to comment.