Formt
This commit is contained in:
@@ -96,8 +96,10 @@ module Day7 =
|
|||||||
else
|
else
|
||||||
let mutable jokerCount = 0
|
let mutable jokerCount = 0
|
||||||
let mutable jokerPos = 0
|
let mutable jokerPos = 0
|
||||||
|
|
||||||
while jokerPos < tallyBuffer.Count && jokerCount = 0 do
|
while jokerPos < tallyBuffer.Count && jokerCount = 0 do
|
||||||
let card, tally = tallyBuffer.[jokerPos]
|
let card, tally = tallyBuffer.[jokerPos]
|
||||||
|
|
||||||
if card = joker then
|
if card = joker then
|
||||||
jokerCount <- tally
|
jokerCount <- tally
|
||||||
else
|
else
|
||||||
|
@@ -11,6 +11,7 @@ type ResizeArray<'T> =
|
|||||||
|
|
||||||
member this.Count = this.Length
|
member this.Count = this.Length
|
||||||
member this.Clear () = this.Length <- 0
|
member this.Clear () = this.Length <- 0
|
||||||
|
|
||||||
member this.Add (t : 'T) =
|
member this.Add (t : 'T) =
|
||||||
if this.Length < this.Array.Length then
|
if this.Length < this.Array.Length then
|
||||||
this.Array.[this.Length] <- t
|
this.Array.[this.Length] <- t
|
||||||
@@ -20,7 +21,9 @@ type ResizeArray<'T> =
|
|||||||
Array.blit this.Array 0 newArray 0 this.Length
|
Array.blit this.Array 0 newArray 0 this.Length
|
||||||
newArray.[this.Length] <- t
|
newArray.[this.Length] <- t
|
||||||
this.Array <- newArray
|
this.Array <- newArray
|
||||||
|
|
||||||
this.Length <- this.Length + 1
|
this.Length <- this.Length + 1
|
||||||
|
|
||||||
member this.Item
|
member this.Item
|
||||||
with get (i : int) = this.Array.[i]
|
with get (i : int) = this.Array.[i]
|
||||||
and set (i : int) (t : 'T) = this.Array.[i] <- t
|
and set (i : int) (t : 'T) = this.Array.[i] <- t
|
||||||
@@ -30,4 +33,8 @@ type ResizeArray<'T> =
|
|||||||
|
|
||||||
[<RequireQualifiedAccess>]
|
[<RequireQualifiedAccess>]
|
||||||
module ResizeArray =
|
module ResizeArray =
|
||||||
let create<'T> (capacity : int) = { Array = Array.zeroCreate<'T> capacity; Length = 0 }
|
let create<'T> (capacity : int) =
|
||||||
|
{
|
||||||
|
Array = Array.zeroCreate<'T> capacity
|
||||||
|
Length = 0
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user