Skip to content

Commit e3cf90f

Browse files
committed
fix syntax highlighting in docs
1 parent 8f39c3b commit e3cf90f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/04_images.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ We use Pillow for this as it has a pretty straight-forward API.
55

66
We define the green pixel in the image as start and the red pixel as end. To have some variation and combat compression we define them as ranges above a certain threshold (although the png-image in our lossless compressed):
77

8-
```
8+
```python
99
def green(pixel: list) -> bool:
1010
"""Returns True if the pixel is green (the starting point)"""
1111
return pixel[RED] < 10 and pixel[GREEN] > 250 and pixel[BLUE] < 10
@@ -18,14 +18,14 @@ def red(pixel: list) -> bool:
1818

1919
Pixel are defined as walkable grid cells if each of their color values is above 50, so a strong gray is enough to make it walkable:
2020

21-
```
21+
```python
2222
def pixel_walkable(pixel, x, y):
2323
"""returns True if the pixel is walkable."""
2424
return any([p > 50 for p in pixel]) # darker pixel are not walkable
2525
```
2626

2727
In the main loop we iterate over all pixel to find start and end and create a boolean matrix as input for our Grid:
28-
```
28+
```python
2929
with Image.open(filename_map) as im:
3030
width, height = im.size
3131
for y in range(height):

0 commit comments

Comments
 (0)