File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -213,33 +213,34 @@ class SudokuFrame{
213213 }
214214
215215 /* *
216- * @desc Displays the values stored in the frame with designs.
216+ * @desc Displays the values stored in the frame with designs. We also use
217+ * ANSI colors, using escape sequences, to display the frame.
217218 * @param none
218219 * @return none
219220 */
220221 public: void displayFrame (){
221222
222- cout<<" ++=====================================++" ;
223+ cout<<" \033 [0;36m ++=====================================++" ;
223224 int rowIter, colIter;
224225
225226 for (rowIter=0 ; rowIter<9 ; rowIter++){
226227 int cellIter=1 ;
227228
228- cout<<" \n ||" ;
229+ cout<<" \n\033 [0;36m ||" ;
229230 for (colIter=0 ; colIter<9 ; colIter++){
230231 if (cellIter==3 ){
231- cout<<" " <<sudokuFrame[rowIter][colIter]<<" " ;
232- cout<<" ||" ;
232+ cout<<" \033 [0m " <<sudokuFrame[rowIter][colIter]<<" " ;
233+ cout<<" \033 [0;36m ||" ;
233234 cellIter=1 ;
234235 }
235236 else {
236- cout<<" " <<sudokuFrame[rowIter][colIter]<<" " ;
237+ cout<<" \033 [0m " <<sudokuFrame[rowIter][colIter]<<" " ;
237238 cellIter++;
238239 }
239240 }
240241
241- if (rowIter%3 !=2 ) cout<<" \n ++-----------++-----------++-----------++" ;
242- else cout<<" \n ++=====================================++" ;
242+ if (rowIter%3 !=2 ) cout<<" \n\033 [0;36m ++-----------++-----------++-----------++" ;
243+ else cout<<" \n\033 [0;36m ++=====================================++" ;
243244 }
244245
245246 }
You can’t perform that action at this time.
0 commit comments