Browse Source

Add color for text after answer input

! Does only work on white background terminals.
DricomDragon 4 years ago
parent
commit
7aa25ff91b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      flashLearn/Revision.cpp

+ 3 - 3
flashLearn/Revision.cpp

@@ -94,8 +94,8 @@ bool Revision::corriger( string saisie[3] )
 
     /// Réussite
     if ( exact ) {
-        cout << "Well done ! Progression : ";
-        cout << 100 - ( m_file.size() * 100 / m_total ) << "%" << endl;
+        cout << "\033[1;32m" << "Well done ! Progression : ";
+        cout << 100 - ( m_file.size() * 100 / m_total ) << "%" << "\033[0;30m" << endl;
 
         /// Retirer de la liste
         delete m_file.front();
@@ -105,7 +105,7 @@ bool Revision::corriger( string saisie[3] )
 
     /// Echec
     else {
-        cout << "Oups ! You will try again later ..." << endl;
+        cout << "\033[1;31m" << "Oups ! You will try again later ..." << "\033[0;30m" << endl;
         cout << "The good answer were";
         for ( int i(0); i<4; i++ )
             cout << ' ' << '"' << m_file.front()->get( i ) << '"';