From 353d185a1f89654f999dca7b75016ebef461a23c Mon Sep 17 00:00:00 2001 From: Tomasz Chojnacki Date: Fri, 30 Dec 2022 14:35:09 +0100 Subject: Finish day 24 --- aoc-2022-dotnet/Common/Util.fs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'aoc-2022-dotnet/Common/Util.fs') diff --git a/aoc-2022-dotnet/Common/Util.fs b/aoc-2022-dotnet/Common/Util.fs index ac5d981..ad177db 100644 --- a/aoc-2022-dotnet/Common/Util.fs +++ b/aoc-2022-dotnet/Common/Util.fs @@ -4,6 +4,7 @@ module Util = open System.Globalization open FParsec open FSharpPlus + open FSharpPlus.Math.Generic let parse parser input = match run parser input with @@ -16,6 +17,9 @@ module Util = let charToInt = CharUnicodeInfo.GetDigitValue + let wrapInRangeInc lower upper x = + lower + remE (x - lower) (upper - lower + 1) + let cutInHalf xs = let half = Seq.length xs / 2 [ Seq.take half xs; Seq.skip half xs ] -- cgit v1.2.3