Skip to content

Commit

Permalink
Fix markdown formatting for examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
havardox committed Sep 17, 2022
1 parent 2860152 commit ace60fb
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
5 changes: 0 additions & 5 deletions examples/fluid.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,24 @@
>>> from polyomino.board import Chessboard
>>> from polyomino.constant import MONOMINO, DOMINO
>>> from polyomino.tileset import many

```

```python
>>> Chessboard()
<polyomino.board.Chessboard object at ...>

```

```python
>>> Chessboard().tile_with_many(DOMINO)
<polyomino.problem.TilingProblem object at ...>

```

```python
>>> Chessboard().tile_with_set(many(DOMINO).and_repeated_exactly(2, MONOMINO))
<polyomino.problem.TilingProblem object at ...>

```

```python
>>> Chessboard().tile_with_set(many(DOMINO).and_repeated_exactly(2, MONOMINO)).with_heuristics()
<polyomino.problem.TilingProblem object at ...>

```
6 changes: 0 additions & 6 deletions examples/gardner.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ These examples are taken from chapter 13 of 'Mathematical Puzzles and Diversions
>>> from polyomino.constant import ONESIDED_TETROMINOS
>>> from polyomino.constant import TETROMINOS, ALL_PENTOMINOS
>>> from polyomino.tileset import many, repeated_exactly, any_number_of

```
>[...]
>In Chapter 3 (problem 3) we considered a polyomino problem dealing with the placing of dominoes on a mutilated chessboard.
Expand All @@ -17,20 +16,17 @@ These examples are taken from chapter 13 of 'Mathematical Puzzles and Diversions
```python
>>> Chessboard().remove((0, 0)).remove((7, 7)).tile_with_many(DOMINO)
<polyomino.problem.TilingProblem object at ...>

```

[An impossible tiling will give the solution `None`.]

```python
>>> Rectangle(4, 4).remove((0, 0)).remove((3, 3)).tile_with_many(DOMINO).solve()

```

```python
>>> Chessboard().remove((0, 0)).remove((0, 7)).tile_with_many(DOMINO).solve().tiling
[[(0, 1), (0, 2)], [(0, 3), (0, 4)], [(0, 5), (0, 6)], [(1, 0), (1, 1)], [(1, 2), (1, 3)], [(1, 4), (1, 5)], [(1, 6), (1, 7)], [(2, 0), (2, 1)], [(2, 2), (2, 3)], [(2, 4), (2, 5)], [(2, 6), (2, 7)], [(3, 0), (3, 1)], [(3, 2), (3, 3)], [(3, 4), (3, 5)], [(3, 6), (3, 7)], [(4, 0), (4, 1)], [(4, 2), (4, 3)], [(4, 4), (4, 5)], [(4, 6), (4, 7)], [(5, 0), (5, 1)], [(5, 2), (5, 3)], [(5, 4), (5, 5)], [(5, 6), (5, 7)], [(6, 0), (6, 1)], [(7, 0), (7, 1)], [(6, 2), (6, 3)], [(7, 2), (7, 3)], [(6, 4), (6, 5)], [(7, 4), (7, 5)], [(6, 6), (6, 7)], [(7, 6), (7, 7)]]

```

```python
Expand Down Expand Up @@ -124,7 +120,6 @@ These examples are taken from chapter 13 of 'Mathematical Puzzles and Diversions
```python
>>> [name for name in ONESIDED_TETROMINOS if Chessboard().tile_with_many(ONESIDED_TETROMINOS[name]).solve() is None]
['S', 'Z']

```

As mentioned on p118, there is an easy argument to show that this is impossible - naive search is computationally intractable.
Expand Down Expand Up @@ -153,5 +148,4 @@ As mentioned on p118, there is an easy argument to show that this is impossible
+ +-+ +-+ +-+ +
| | | | |
+-+-+-+-+-+-+-+-+

```
3 changes: 0 additions & 3 deletions examples/more.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
```python
>>> from polyomino.board import Irregular, Rectangle
>>> from polyomino.constant import TETROMINOS

```

```python
Expand Down Expand Up @@ -42,7 +41,6 @@
+ +-+ +-+ +-+ +-+-+ +-+ +
| | | | | | |
+-+-+-+-+-+-+-+-+-+-+-+-+

```

```python
Expand Down Expand Up @@ -104,5 +102,4 @@
+-+ +-+ +
| | | |
+-+ +-+

```

0 comments on commit ace60fb

Please sign in to comment.