Skip to content

Commit 292ef7b

Browse files
author
Ram Rachum
committed
-
1 parent 67e5741 commit 292ef7b

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

garlicsim/docs/intro/tutorial1.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ node to the tree as a root. The method returned the new node. Let's see some
307307
info about our node:
308308

309309
>>> root
310-
<garlicsim.data_structures.Node with clock 0, root, leaf, touched, blockless, at 0x1c68ed0>
310+
<garlicsim.data_structures.Node with clock 0,
311+
root, leaf, touched, blockless, at 0x1c68ed0>
311312

312313
The ``clock 0`` thing means that the clock reading of this node's state is zero.
313314
The states that will succeed it will have incrementing clock readings. The
@@ -357,7 +358,8 @@ Okay, now that the results of our simulation are ready, let's take a look at our
357358
tree:
358359

359360
>>> project.tree
360-
<garlicsim.data_structures.Tree with 1 roots, 51 nodes and 1 possible paths at 0x1c68810>
361+
<garlicsim.data_structures.Tree with 1 roots,
362+
51 nodes and 1 possible paths at 0x1c68810>
361363

362364
Our tree has only one possible :class:`Path <garlicsim.data_structures.Path>` in
363365
it. A :class:`Path <garlicsim.data_structures.Path>` represents one timeline
@@ -373,14 +375,17 @@ Let's fork our tree. But before that, let's get that single path:
373375
>>> path
374376
<garlicsim.data_structures.Path of length 51 at 0x1ccfb30>
375377

376-
:class:`Path <garlicsim.data_structures.Path>` is a list-like object. We can get any node we want from it using its index number. Let's see how our diehard is doing at clock 50:
378+
:class:`Path <garlicsim.data_structures.Path>` is a list-like object. We can get
379+
any node we want from it using its index number. Let's see how our diehard is
380+
doing at clock 50:
377381

378382
.. _original_clock_50:
379383

380384
::
381385

382386
>>> path[-1]
383-
<garlicsim.data_structures.Node with clock 50, leaf, untouched, belongs to a block, crunched with StepProfile(), at 0x1cd9070>
387+
<garlicsim.data_structures.Node with clock 50, leaf, untouched,
388+
belongs to a block, crunched with StepProfile(), at 0x1cd9070>
384389
>>>
385390
>>>
386391
>>> path[-1].state
@@ -493,11 +498,13 @@ it can start crunching from that node.
493498
We can see our tree now has two possible paths:
494499

495500
>>> project.tree
496-
<garlicsim.data_structures.Tree with 1 roots, 52 nodes and 2 possible paths at 0x1c68810>
501+
<garlicsim.data_structures.Tree with 1 roots,
502+
52 nodes and 2 possible paths at 0x1c68810>
497503

498504
The fork happens on clock 27, since that is the one we duplicated for editing.
499505

500-
Now we want to crunch from our new node up to a clock of 50, like in the original timeline:
506+
Now we want to crunch from our new node up to a clock of 50, like in the
507+
original timeline:
501508

502509
>>> project.ensure_buffer(root, 50)
503510

@@ -551,9 +558,9 @@ And now, to see what happens in clock 50 in our alternate timeline::
551558

552559
>>>
553560

554-
This is a very different state from :ref:`the one <original_clock_50>` in the original timeline! It has
555-
about twice as many live cells. This is a reminder of how a small change in the
556-
present can cause a big change in the future.
561+
This is a very different state from :ref:`the one <original_clock_50>` in the
562+
original timeline! It has about twice as many live cells. This is a reminder of
563+
how a small change in the present can cause a big change in the future.
557564

558565
.. _degenerate: http://en.wikipedia.org/wiki/Degeneracy_(mathematics)
559566
.. _Metushelah: http://en.wikipedia.org/wiki/Methuselah_(cellular_automata)

0 commit comments

Comments
 (0)