Skip to content

Commit 8a32405

Browse files
Imad HachimiGitHub Enterprise
authored andcommitted
Merge pull request #2 from IN1910/part1new
Part1new
2 parents a8c64c9 + 7f4dc82 commit 8a32405

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

chaos_game.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def _starting_point(self):
7777
spoint[1] += w[i] * self._corners[i][1]
7878
return spoint
7979

80-
def iterate(self, steps: int = 10, discard: int = 5):
80+
def iterate(self, steps: int = 10000, discard: int = 100):
8181
"""Discards the first discard points.
8282
The third element in each tuple is the random chosen corner index
8383
be aware that, currently, index is a float"""
@@ -131,7 +131,7 @@ def gradient_color(self):
131131
colors = iter([plt.cm.tab20(i) for i in range(20)])
132132
cc = []
133133
i = 0
134-
# TODO: this can only create a limited number of colors then repeat
134+
# TODO: this can only create a limited number of colors then repeat set pattern
135135
while len(cc) < self._corners.shape[0]:
136136
cc.append(next(colors))
137137
i += 1

triangle.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import chaos_game as cg
2+
3+
4+
triangle = cg.ChaosGame()
5+
triangle.iterate(20000, 100)
6+
triangle.show(True)

0 commit comments

Comments
 (0)