Skip to content

Commit

Permalink
Merge pull request #19 from dieseltravis/glitch
Browse files Browse the repository at this point in the history
⛩️🪑 Updated with Glitch: fixed joker consumption
  • Loading branch information
dieseltravis authored Dec 11, 2023
2 parents d817c2b + 095acd4 commit 1eaa273
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
Expand Down
7 changes: 5 additions & 2 deletions public/funs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h2>solutions:</h2>
<li><a href="/day/04">day 04</a></li>
<li><a href="/day/05">day 05</a></li>
<li><a href="/day/06">day 06</a></li>
<li><a href="/day/07">day 07</a> part 2 wip</li>
<li><a href="/day/07">day 07</a></li>
<li><a href="/day/08">day 08</a> part 2 wip</li>
<li><a href="/day/09">day 09</a></li>
<li><a href="/day/10">day 10</a></li>
Expand Down

0 comments on commit 1eaa273

Please sign in to comment.