From 095acd4f981581b1943b42da76f323c725116501 Mon Sep 17 00:00:00 2001 From: "Glitch (branch-three-oviraptor)" Date: Mon, 11 Dec 2023 04:03:40 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9B=A9=EF=B8=8F=F0=9F=AA=91=20Updated=20with?= =?UTF-8?q?=20Glitch:=20fixed=20joker=20consumption?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- public/funs.js | 7 +++++-- views/index.html | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bb4b870..bf2cd7d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ my 2023 solutions on glitch: [branch-three-oviraptor](https://branch-three-ovira also on github: [dieseltravis/aoc2023](https://github.com/dieseltravis/aoc2023) -[![Days completed in a row](https://img.shields.io/badge/⭐%20days%20in%20a%20row-6-blueviolet)](https://adventofcode.com/2023/) [![glitch](https://shields.io/badge/glitch-%F0%9F%91%8D%F0%9F%8E%8F-blue?logo=glitch&logoColor=violet)](https://glitch.com/) +[![Days completed in a row](https://img.shields.io/badge/⭐%20days%20in%20a%20row-7-blueviolet)](https://adventofcode.com/2023/) [![glitch](https://shields.io/badge/glitch-%F0%9F%91%8D%F0%9F%8E%8F-blue?logo=glitch&logoColor=violet)](https://glitch.com/) [![Node.js CI](https://github.com/dieseltravis/aoc2023/actions/workflows/node.js.yml/badge.svg)](https://github.com/dieseltravis/aoc2023/actions/workflows/node.js.yml) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fdieseltravis%2Faoc2023.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fdieseltravis%2Faoc2023?ref=badge_shield) [![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?logo=javascript)](https://github.com/standard/semistandard) @@ -17,7 +17,7 @@ also on github: [dieseltravis/aoc2023](https://github.com/dieseltravis/aoc2023) 4. [day four](https://branch-three-oviraptor.glitch.me/day/04) 5. [day five](https://branch-three-oviraptor.glitch.me/day/05) 6. [day six](https://branch-three-oviraptor.glitch.me/day/06) -7. [day seven](https://branch-three-oviraptor.glitch.me/day/07) part 2 wip +7. [day seven](https://branch-three-oviraptor.glitch.me/day/07) 8. [day eight](https://branch-three-oviraptor.glitch.me/day/08) part 2 wip 9. [day nine](https://branch-three-oviraptor.glitch.me/day/09) 10. [day ten](https://branch-three-oviraptor.glitch.me/day/10) diff --git a/public/funs.js b/public/funs.js index 3f81ebd..05f063c 100644 --- a/public/funs.js +++ b/public/funs.js @@ -530,19 +530,21 @@ if (count === i) { if (count === 5) { val.five = 1; + h = h.join('').replace(/J/g, c1).split(''); i = 0; j = csl; } else if (count === 4) { val.four = 1; val.high = 1; + h = h.join('').replace(/J/g, c1).split(''); i = 0; j = csl; } else if (count === 3) { val.three = 1; - h = h.join('').replace('J', c1).split(''); + h = h.join('').replace(/J/g, c1).split(''); } else if (count === 2) { val.pair += 1; - h = h.join('').replace('J', c1).split(''); + h = h.join('').replace(/J/g, c1).split(''); } else if (count === 1) { val.high = 1; } @@ -597,6 +599,7 @@ }); const answer = sorted.reduce((a, v, i) => a + (v.bid * (i + 1)), 0); console.log(sorted, answer); + // 251824095? // 251910588 is wrong // 251794152 is wrong // 251681150 is too low diff --git a/views/index.html b/views/index.html index 182096f..0544efb 100644 --- a/views/index.html +++ b/views/index.html @@ -26,7 +26,7 @@

solutions:

  • day 04
  • day 05
  • day 06
  • -
  • day 07 part 2 wip
  • +
  • day 07
  • day 08 part 2 wip
  • day 09
  • day 10