Is There A Way To Hide Previous Text?

I was wondering if there's a way to clear text on a program. For example, when "y" is pressed to play again I want it to clear the text above it so it doesn't look jumbled together and to give the appearance that the score is staying in the top left and updating. Also, it there another way I could keep a score in the top left that updates? I wasn't sure how to explain this, tell me if I need to explain this in more detail.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <string>

using namespace std;

int main()
{
    int p;
    int c;
    int a;
    string yes;
    int computerScore = 0;
    int playerScore = 0;

    do{

    do{
        cout << "\nPlayer Score - " << playerScore << " Comp Score - " << computerScore;

    cout << "\n\nEnter a number 1-10\n";
    cin >> p;

    }while ( p > 10);



    srand(time(0));
    c = rand()%10 + 1;

    cout << "\nThe computer chose " << c << endl;
    cin.get();

    if (c > p){
    cout << "You lose!\n";
    ++computerScore;
    }

    if (c < p){
    cout << "You win!\n";
    ++playerScore;
    }

    if (c == p){
    cout << "Tie!\n";
    }

    cout << "\nDo you want to play again? Y/N\n\n";
    cin >> yes;




    }while (yes == "y");

    cout << "Thanks for playing!";

}
The console (the black window you see when using cout/cin) prints out on a purely sequential basis, so no, you can't update text from previous cout's.

To clear the screen, there's two easy ways posted here:
http://www.cplusplus.com/forum/beginner/3207/

system commands are apparently bad practice, but I'm not nearly experienced enough to understand why and give my own opinion. Printing a load of empty lines seems sufficient for the case at hand though.
Topic archived. No new replies allowed.