Skip to content

Commit 95c18c1

Browse files
committed
fix(maze): fix endlines for maze examples
1 parent d0bc935 commit 95c18c1

1 file changed

Lines changed: 42 additions & 42 deletions

File tree

  • artificialintelligence/assignments/maze

artificialintelligence/assignments/maze/README.md

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ There are many ways to implement a maze generation and one of the most common is
2424

2525
## Random Number Generation
2626

27-
In order do be consistent with all languages and random functions the pseudo random number generation should follow the following sequence of 100 numbers:
27+
In order to be consistent with all languages and random functions the pseudo random number generation should follow the following sequence of 100 numbers:
2828

2929
```
3030
[72, 99, 56, 34, 43, 62, 31, 4, 70, 22, 6, 65, 96, 71, 29, 9, 98, 41, 90, 7, 30, 3, 97, 49, 63, 88, 47, 82, 91, 54, 74, 2, 86, 14, 58, 35, 89, 11, 10, 60, 28, 21, 52, 50, 55, 69, 76, 94, 23, 66, 15, 57, 44, 18, 67, 5, 24, 33, 77, 53, 51, 59, 20, 42, 80, 61, 1, 0, 38, 64, 45, 92, 46, 79, 93, 95, 37, 40, 83, 13, 12, 78, 75, 73, 84, 81, 8, 32, 27, 19, 87, 85, 16, 25, 17, 68, 26, 39, 48, 36];
@@ -38,7 +38,7 @@ In order to give consistency on how to decide the direction of the next cell, th
3838

3939
1. List all visitable neighbors of the current cell;
4040
2. Sort the list of visitable neighbors by clockwise order, starting from the top neighbor: UP, RIGHT, DOWN, LEFT;
41-
3. If there are one visitable, do not call random, just return the first neighbor found;
41+
3. If there is one visitable, do not call random, just return the first neighbor found;
4242
4. If there are two or more visitable neighbors, call random and return the neighbor at the index of the random number modulo the number of visitable neighbors. `vec[i]%visitableCount`
4343

4444
## Input
@@ -58,12 +58,12 @@ Every line is a combination of underscore `_`, pipe `|` and empty ` ` character
5858
The initial state of the 2 x 2 map is:
5959

6060
```
61-
_ _
62-
|_|_|
63-
|_|_|
61+
_ _
62+
|_|_|
63+
|_|_|
6464
```
6565

66-
In order to interactively solve this, we will, add `(0,0)` to the queue.
66+
In order to interactively solve this, we will add `(0,0)` to the queue.
6767

6868
The neighbors of the current top (0,0) are RIGHT and DOWN, `(0,1)` and `(1,0)` respectively.
6969

@@ -76,29 +76,29 @@ The random number is `72` and the number of neighbors is `2`, so the index of th
7676
The wall between `(0,0)` and `(0,1)` is removed, and `(0,1)` is added to the queue. Now it holds `[(0,0), (0,1)]`. The map is now:
7777

7878
```
79-
_ _
80-
|_ _|
81-
|_|_|
79+
_ _
80+
|_ _|
81+
|_|_|
8282
```
8383

8484
Now the only neighbor of (0,1) is DOWN, (1,1). So no need to call random, we just choose the only neighbor.
8585

8686
The wall between `(0,1)` and `(1,1)` is removed, and `(1,1)` is added to the queue. Now it holds `[(0,0), (0,1), (1,1)]`. The map is now:
8787

8888
```
89-
_ _
90-
|_ |
91-
|_|_|
89+
_ _
90+
|_ |
91+
|_|_|
9292
```
9393

9494
Now the only neighbor of `(1,1)` is LEFT, `(1,0)`. So no need to call random, we just choose the only neighbor.
9595

9696
The wall between (1,1) and (1,0) is removed, and (1,0) is added to the queue. Now it holds `[(0,0), (0,1), (1,1), (1,0)]`. The map is now:
9797

9898
```
99-
_ _
100-
|_ |
101-
|_ _|
99+
_ _
100+
|_ |
101+
|_ _|
102102
```
103103

104104
Now, the current top of the queue is `(1,0)` and there isn't any neighbor to be visited, so we remove the current top `(1,0)` from the queue and backtrack. The queue is now `[(0,0), (0,1), (1,1)]`.
@@ -110,43 +110,43 @@ The current top is `(0,1)` and there isn't any neighbor to be visited, so we rem
110110
The current top is `(0,0)` and there isn't any neighbor to be visited, so we remove `(0,0)` from the queue and backtrack. The queue is now empty and we finish priting the map state. The final map is:
111111

112112
```
113-
_ _
114-
|_ |
115-
|_ _|
113+
_ _
114+
|_ |
115+
|_ _|
116116
```
117117

118118
And this the only one that should be printed. No intermediary maps should be printed.
119119

120-
!!! example "Example 1"
120+
## Example 1
121121

122-
=== "Input"
122+
### Input 1
123123

124-
```
125-
3 3 0
126-
```
124+
```
125+
3 3 0
126+
```
127127

128-
=== "Output"
128+
### Output 1
129129

130-
```
131-
_ _ _
132-
|_ | |
133-
| _| |
134-
|_ _ _|
135-
```
130+
```
131+
_ _ _
132+
|_ | |
133+
| _| |
134+
|_ _ _|
135+
```
136136

137-
!!! example "Example 2"
137+
## Example 2
138138

139-
=== "Input"
139+
### Input 2
140140

141-
```
142-
3 3 1
143-
```
141+
```
142+
3 3 1
143+
```
144144

145-
=== "Output"
145+
### Output2
146146

147-
```
148-
_ _ _
149-
| |_ |
150-
|_ _ |
151-
|_ _ _|
152-
```
147+
```
148+
_ _ _
149+
| |_ |
150+
|_ _ |
151+
|_ _ _|
152+
```

0 commit comments

Comments
 (0)