Output programu (warto dorzucić na przyszłość):
The cell is (1, a)
The cell is (1, b)
The cell is (1, c)
The cell is (1, d)
The cell is (1, e)
The cell is (1, f)
The cell is (1, g)
The cell is (1, h)
The cell is (1, i)
The cell is (1, j)
The cell is (2, a)
The cell is (2, b)
The cell is (2, c)
The cell is (2, d)
The cell is (2, e)
The cell is (2, f)
The cell is (2, g)
The cell is (2, h)
The cell is (2, i)
The cell is (2, j)
The cell is (3, a)
The cell is (3, b)
The cell is (3, c)
The cell is (3, d)
The cell is (3, e)
The cell is (3, f)
The cell is (3, g)
The cell is (3, h)
The cell is (3, i)
The cell is (3, j)
The cell is (4, a)
The cell is (4, b)
The cell is (4, c)
The cell is (4, d)
The cell is (4, e)
The cell is (4, f)
The cell is (4, g)
The cell is (4, h)
The cell is (4, i)
The cell is (4, j)
The cell is (5, a)
The cell is (5, b)
The cell is (5, c)
The cell is (5, d)
The cell is (5, e)
The cell is (5, f)
The cell is (5, g)
The cell is (5, h)
The cell is (5, i)
The cell is (5, j)
The cell is (6, a)
The cell is (6, b)
The cell is (6, c)
The cell is (6, d)
The cell is (6, e)
The cell is (6, f)
The cell is (6, g)
The cell is (6, h)
The cell is (6, i)
The cell is (6, j)
The cell is (7, a)
The cell is (7, b)
The cell is (7, c)
The cell is (7, d)
The cell is (7, e)
The cell is (7, f)
The cell is (7, g)
The cell is (7, h)
The cell is (7, i)
The cell is (7, j)
The cell is (8, a)
The cell is (8, b)
The cell is (8, c)
The cell is (8, d)
The cell is (8, e)
The cell is (8, f)
The cell is (8, g)
The cell is (8, h)
The cell is (8, i)
The cell is (8, j)
The cell is (9, a)
The cell is (9, b)
The cell is (9, c)
The cell is (9, d)
The cell is (9, e)
The cell is (9, f)
The cell is (9, g)
The cell is (9, h)
The cell is (9, i)
The cell is (9, j)
The cell is (10, a)
The cell is (10, b)
The cell is (10, c)
The cell is (10, d)
The cell is (10, e)
The cell is (10, f)
The cell is (10, g)
The cell is (10, h)
The cell is (10, i)
The cell is (10, j)
Dlaczego po wypisaniu litery j program dalej się wykonuje przecież pętla ma zwiększać wartość zmiennej o 1 więc powinna zwiększyć do k i się nie wykonać bo k < k.
W tym zdaniu jest jedna prawdziwa rzecz - pętla ma zwiększać wartość zmiennej o 1 więc powinna zwiększyć do k i się nie wykonać bo k < k. - tak się też dzieje, pętla wewnętrzna (z itratorem column) zwiększa się od 'a' do 'j'. Kwestia w tym, że mamy tutaj pętlę w pętli, więc pętla wewnętrzna wykona się 11 razu od początku - ad 'a', do końca ' do 'j'. za kążdym razem przy 'k' się skończy. Na danych można to podzielić tak:
== tu zaczyna się pętla zewnętrzna ==
-- row = 1 --
== tu zaczyna się pętla wewnętrzna ==
-- cell = a --
The cell is (1, a)
-- cell = b --
The cell is (1, b)
-- cell = c --
The cell is (1, c)
-- cell = d --
The cell is (1, d)
-- cell = e --
The cell is (1, e)
-- cell = f --
The cell is (1, f)
-- cell = g --
The cell is (1, g)
-- cell = h --
The cell is (1, h)
-- cell = i --
The cell is (1, i)
-- cell = j --
The cell is (1, j)
-- cell = k - poza zakresem, kończymy--
== tu kończy się pętla wewnętrzna ==
-- row = 2 --
== tu zaczyna się pętla wewnętrzna ==
-- cell = a --
The cell is (1, a)
-- cell = b --
The cell is (1, b)
-- cell = c --
The cell is (1, c)
-- cell = d --
The cell is (1, d)
-- cell = e --
The cell is (1, e)
-- cell = f --
The cell is (1, f)
-- cell = g --
The cell is (1, g)
-- cell = h --
The cell is (1, h)
-- cell = i --
The cell is (1, i)
-- cell = j --
The cell is (1, j)
-- cell = k - poza zakresem, kończymy--
== tu kończy się pętla wewnętrzna ==
...
-- row = 10 --
== tu zaczyna się pętla wewnętrzna ==
-- cell = a --
The cell is (1, a)
-- cell = b --
The cell is (1, b)
-- cell = c --
The cell is (1, c)
-- cell = d --
The cell is (1, d)
-- cell = e --
The cell is (1, e)
-- cell = f --
The cell is (1, f)
-- cell = g --
The cell is (1, g)
-- cell = h --
The cell is (1, h)
-- cell = i --
The cell is (1, i)
-- cell = j --
The cell is (1, j)
-- cell = k - poza zakresem, kończymy--
== tu kończy się pętla wewnętrzna ==
-- row = 11 - poza zakressem, kończymy --
== tu kończy się pętla zewnętrzna ==