Commit c3fed2f8 authored by Nelson Phillips's avatar Nelson Phillips
Browse files

autosave

parent dadb1315
...@@ -29,57 +29,7 @@ void foo() { ...@@ -29,57 +29,7 @@ void foo() {
system("stty raw"); system("stty raw");
input = getchar(); input = getchar();
system("stty cooked"); system("stty cooked");
cout << endl;
if(input == 'w'|| input == 'W')
x--;
else
if(input == 'a'|| input == 'A')
y--;
else
if(input == 's'|| input == 'S')
x++;
else
if(input == 'd'|| input == 'D')
y++;
else
x++;
for (int p = 0; p < 40; p++){
cout << endl;
}
for (int p = 0; p < 40; p++){
cout << endl;
}
cout << "Your score is : " << score << endl;
for (int i = 0; i < 14; i++){
cout << endl;
for (int q = 0; q < 14; q++){
if (x < 0)x++;
if (y < 0)y++;
if (x > 13)x--;
if (y > 13)y--;
if (h == i || o == q)
grid[h][o] = '*';
if (i == x && q == y)
grid[x][y] = 'H';
else if (i != h || o != q)
grid[i][q] = letter;
cout << grid[i][q] << " ";
}
}
if (grid [x][y] == grid[h][o] ){
h = (rand() % 14);
o = (rand() % 14);
score++;
}
} }
} }
void bar(){ void bar(){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment