Created
December 1, 2021 14:51
-
-
Save FeepingCreature/2373008f50c856eb3f60a707977b742d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module day1_2; | |
macro import neat.macros.listcomprehension; | |
import std.stdio; | |
import std.file; | |
import std.string; | |
void main() { | |
[depth.atoi for depth in "day1.txt".readText.split("\n")] | |
.([depth + that[i + 1] + that[i + 2] for i, depth in that[0 .. $ - 2]]) | |
.([(sum, that[i + 1]) for i, sum in that[0 .. $ - 1]]) | |
.([count pair in that where pair[0] < pair[1]]) | |
.(print("$that increases.")); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment