2020-10-19 21:08:55

This commit is contained in:
wizardforcel
2020-10-19 21:08:55 +08:00
parent 7f63048035
commit ab0caba1f0
140 changed files with 3982 additions and 3982 deletions

View File

@@ -12,7 +12,7 @@
In [1]:
```
```py
class Leaf(object):
def __init__(self, color="green"):
self.color = color
@@ -25,7 +25,7 @@ class Leaf(object):
In [2]:
```
```py
class MapleLeaf(Leaf):
def fall(self):
self.color = 'brown'
@@ -37,7 +37,7 @@ class MapleLeaf(Leaf):
In [3]:
```
```py
class Acorn(object):
def fall(self):
print "Plunk!"
@@ -48,7 +48,7 @@ class Acorn(object):
In [4]:
```
```py
objects = [Leaf(), MapleLeaf(), Acorn()]
for obj in objects:
@@ -56,7 +56,7 @@ for obj in objects:
```
```
```py
Splat!
Splat!
Plunk!
@@ -69,7 +69,7 @@ Plunk!
In [5]:
```
```py
import numpy as np
from scipy.ndimage.measurements import label
@@ -198,7 +198,7 @@ class InstantBurnForest(BurnableForest):
In [6]:
```
```py
forest = Forest()
b_forest = BurnableForest()
sb_forest = SlowBurnForest()
@@ -219,7 +219,7 @@ for i in xrange(1500):
In [7]:
```
```py
import matplotlib.pyplot as plt
%matplotlib inline