File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -25,4 +25,12 @@ void printPatternByConsole(TPattern* pPattern) {
2525
2626 printf ("\n" );
2727 }
28+ }
29+
30+ void setPatternCenter (TPattern * pPattern ) {
31+ int row = pPattern -> rows / 2 ;
32+ int col = pPattern -> cols / 2 ;
33+
34+ pPattern -> center [0 ] = row ;
35+ pPattern -> center [1 ] = col ;
2836}
Original file line number Diff line number Diff line change @@ -23,4 +23,14 @@ void fillPattern(TPattern* pPattern, char with);
2323 */
2424void printPatternByConsole (TPattern * pPattern );
2525
26- #endif // PATTERNS_METHODS_H_INCLUDED
26+ /**
27+ * @brief Sets the center of a pattern structure.
28+ *
29+ * @param pPattern A pointer to the pattern structure.
30+ *
31+ * @warning This function assumes that `pPattern` has been properly initialized with valid `rows`
32+ * and `cols` field values.
33+ */
34+ void setPatternCenter (TPattern * pPattern );
35+
36+ #endif // PATTERNS_METHODS_H_INCLUDED
You can’t perform that action at this time.
0 commit comments