Skip to content

Commit

Permalink
namespacing: move modules to Minesweeper
Browse files Browse the repository at this point in the history
  • Loading branch information
dianne committed Aug 20, 2018
1 parent 80f67e2 commit c557dc0
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Board.agda → Minesweeper/Board.agda
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module Minesweeper.Board where

open import Data.Vec as Vec using (Vec)
open import Data.Product
open import Relation.Binary.PropositionalEquality

open import Coords
open import Minesweeper.Coords

Board : Set Bounds Set
Board A (w , h) = Vec (Vec A w) h
Expand Down
4 changes: 3 additions & 1 deletion Coords.agda → Minesweeper/Coords.agda
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module Minesweeper.Coords where

open import Data.Nat
open import Data.Integer using (∣_∣; _⊖_)
open import Data.Product
open import Data.Fin hiding (_≟_)
open import Relation.Binary using (Decidable)
open import Relation.Binary.PropositionalEquality

open import Enumeration as Enum using (Enumeration)
open import Minesweeper.Enumeration as Enum using (Enumeration)

Bounds : Set
Bounds = ℕ × ℕ
Expand Down
2 changes: 1 addition & 1 deletion Enumeration.agda → Minesweeper/Enumeration.agda
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Enumeration where
module Minesweeper.Enumeration where

open import Data.List as List using (List; []; _∷_)
import Data.List.Categorical as List
Expand Down
8 changes: 5 additions & 3 deletions Moves.agda → Minesweeper/Moves.agda
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
-- a hopefully-self-evident description of valid minesweeper moves

open import Coords
open import Board
open import Rules
module Minesweeper.Moves where

open import Minesweeper.Coords
open import Minesweeper.Board
open import Minesweeper.Rules

data Tile : Set where
known : KnownTile Tile
Expand Down
8 changes: 5 additions & 3 deletions Rules.agda → Minesweeper/Rules.agda
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
-- the rules of filled minesweeper boards: do the numbers tell the truth?

module Minesweeper.Rules where

open import Data.Unit
open import Data.Product
open import Data.Nat as ℕ using (ℕ)
Expand All @@ -9,9 +11,9 @@ open import Relation.Binary using () renaming (Decidable to Decidable₂)
open import Relation.Unary using () renaming (Decidable to Decidable₁)
open import Relation.Nullary

open import Coords
open import Board
open import Enumeration as Enum using (Enumeration)
open import Minesweeper.Coords
open import Minesweeper.Board
open import Minesweeper.Enumeration as Enum using (Enumeration)

data KnownTile : Set where
mine : KnownTile
Expand Down

0 comments on commit c557dc0

Please sign in to comment.