< Summary

Information
Class: Minesweeper.MineFieldModule
Assembly: Minesweeper
File(s): /home/runner/work/kata-fsharp-tdd-minesweeper4/kata-fsharp-tdd-minesweeper4/src/Minesweeper/MineField.fs
Tag: 7_2446904407
Line coverage
0%
Covered lines: 0
Uncovered lines: 10
Coverable lines: 10
Total lines: 25
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Method coverage is only available for sponsors.

Upgrade to PRO version

Coverage History

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
start(...)0%20%
click(...)0%20%

File(s)

/home/runner/work/kata-fsharp-tdd-minesweeper4/kata-fsharp-tdd-minesweeper4/src/Minesweeper/MineField.fs

#LineLine coverage
 1namespace Minesweeper
 2
 3type Width = int
 4type Height = int
 5type MineItems<'a> = Map<(int*int), MineItem<'a>>
 6
 7type MineField =
 8    | Setup of Width * Height
 9    | Playing of Width * Height * MineItems<Cell>
 10
 11module MineField =
 12    let start v =
 013        match v with
 014        | Setup (w, h) -> Playing (w, h, seq {
 015            for y in 1..h do
 016            for x in 1..w do
 017            yield ((y, x), Covered Cell.init)
 018        } |> Map.ofSeq)
 19
 20    let rec click v pos =
 021        match v with
 022        | Setup _ -> start v
 23        | Playing (w, h, z) ->
 024            let clicked = z.Change (pos, Option.map MineItem.click)
 025            Playing (w, h, clicked)