Skip to content

Commit 2818fe2

Browse files
committed
Docs: tweak tutorial code after capturing video.
1 parent d8fc747 commit 2818fe2

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

examples/no-spoon/no_spoon.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,35 @@
11
# `no_spoon.py` - a CodinGame challenge
2-
# ==============================================================================
2+
# =====================================
33
#
44
# This file demonstrates the use of literate programming in solving the
5-
# ["There is no Spoon"](https://www.codingame.com/ide/puzzle/there-is-no-spoon-episode-1)
5+
# [There is no Spoon](https://www.codingame.com/ide/puzzle/there-is-no-spoon-episode-1)
66
# programming challenge.
77
#
8+
# Imports
9+
# -------
10+
11+
import sys
12+
import math
13+
814
# Input
9-
# ------------------------------------------------------------------------------
15+
# -----
16+
#
17+
# Don't let the machines win. You are humanity's last hope...
1018
#
1119
# First, read the input provided by the challenge:
1220
#
1321
# The number of cells on the X axis.
1422
width = int(input())
1523
# The number of cells on the Y axis.
1624
height = int(input())
17-
# Read the grid of cells:
25+
# Read in a grid of cell:
1826
#
1927
# * Each line is `width` characters.
2028
# * The characters are either `0` (occupied) or `.` (empty).
2129
#
2230
# From the website, here's an example grid:
2331
#
24-
# <img src="example_grid.png" alt="" width="50%" height="50%">
32+
# ![](example_grid.png)
2533
#
2634
# The text which creates this grid is:
2735
#
@@ -30,15 +38,15 @@
3038
# 0.
3139
# ```
3240
#
33-
# Store this an an array of lines; each lines contains these characters.
34-
# Therefore, `line[y][x]` gives the cell at the coordinate $(𝑥,𝑦)$ (note the
41+
# Store this an an array of lines; each line contains these characters.
42+
# Therefore, `line[y][x]` gives the cell at the coordinate $(x,y)$ (note the
3543
# reversed order).
3644
line = []
3745
for y in range(height):
3846
line.append(input())
3947

4048
# Processing and output
41-
# ------------------------------------------------------------------------------
49+
# ---------------------
4250
#
4351
# From the rules:
4452
#

0 commit comments

Comments
 (0)