Skip to content

Commit ea83f2b

Browse files
hozlucas28TiagoGiannottiGuidolinares
committed
feature(constructors): call setPatternCenter on each constructor
Co-authored-by: Tiago Giannotti <[email protected]> Co-authored-by: Guidolinares <[email protected]>
1 parent 084950e commit ea83f2b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

libs/patterns/constructors.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ void newGliderPattern(TPattern* pattern) {
77
pattern->rows = 3;
88
pattern->cols = 3;
99

10+
setPatternCenter(pattern);
11+
1012
fillPattern(pattern, DEAD_CELL);
1113

1214
pattern->arr[0][2] = ALIVE_CELL;
@@ -20,6 +22,8 @@ void newGliderCannonPattern(TPattern* pattern) {
2022
pattern->rows = 9;
2123
pattern->cols = 36;
2224

25+
setPatternCenter(pattern);
26+
2327
fillPattern(pattern, DEAD_CELL);
2428

2529
pattern->arr[4][0] = ALIVE_CELL;
@@ -66,6 +70,8 @@ void newPressPattern(TPattern* pattern) {
6670
pattern->rows = 13;
6771
pattern->cols = 13;
6872

73+
setPatternCenter(pattern);
74+
6975
fillPattern(pattern, DEAD_CELL);
7076

7177
pattern->arr[0][2] = ALIVE_CELL;
@@ -131,6 +137,8 @@ void newToadPattern(TPattern* pattern) {
131137
pattern->rows = 2;
132138
pattern->cols = 4;
133139

140+
setPatternCenter(pattern);
141+
134142
fillPattern(pattern, DEAD_CELL);
135143

136144
pattern->arr[0][1] = ALIVE_CELL;

0 commit comments

Comments
 (0)