From e3ee6aefe147628ed936eea450b82b05ba7410ac Mon Sep 17 00:00:00 2001 From: Bert Peters Date: Thu, 21 Dec 2017 14:45:20 +0100 Subject: [PATCH] Apparantly, part 1 is fast enough for part 2. --- 2017/README.md | 3 +-- 2017/day-21/solution.coffee | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/2017/README.md b/2017/README.md index 99e090e..c60e3c5 100644 --- a/2017/README.md +++ b/2017/README.md @@ -12,8 +12,7 @@ The current plan, in no particular order: - [x] C++ - [Day 01](./day-01/solution.cpp) - [x] C# - [Day 07](./day-07/solution.cs) - [x] Clojure - [Day 03](./day-03/solution.clj) -- [ ] Coffeescript - [Day 21](./day-21/solution.coffee) (Need to finish - part 2) +- [x] Coffeescript - [Day 21](./day-21/solution.coffee) - [x] Go - [Day 13](./day-13/solution.go) - [x] Groovy - [Day 16](./day-16/solution.groovy) - [x] Haskell - [Day 15](./day-15/solution.hs) diff --git a/2017/day-21/solution.coffee b/2017/day-21/solution.coffee index a1979cd..8ba03c1 100644 --- a/2017/day-21/solution.coffee +++ b/2017/day-21/solution.coffee @@ -45,7 +45,7 @@ stdin.on 'end', () -> state = '.#./..#/###' view state - for _ in [1..5] + for _ in [1..18] newrows = [] oldrows = state.split '/' @@ -77,5 +77,4 @@ stdin.on 'end', () -> newrows.push row state = newrows.join '/' - console.log(state.count(/#/g)) - view state + console.log _, state.count(/#/g)