| CODE |
| #include <stdlib.h> #include <windows.h> #include <iostream> #include <string> //define the keys #define VK_A 0x41 #define VK_D 0x44 #define VK_S 0x53 #define VK_W 0x57 using namespace std; int main() { INPUT_RECORD InputRecord; //set all the variables int caca = 0; int x = 32; int y = 10; int xx = 32; int yy = 16; int score; int i; int ii; int xvar; int yvar; int cana; int canw; int cand; int cans; int cacaca; string str; string str2; do { //set other variables xvar = 0; yvar = 0; //repeat for (i=0;i<23;i++) { //repeat for (ii=0;ii<79;ii++) { //if O and o are collided if ((xx == x) && (yy = y)) { //move o and set score +1 xx = rand()/20/25; yy = rand()/20/100; score+=1; } else //this part is the glitch part, sometimes when O is same y as o, and O x is smaller then o x(xx), then O doesnt show up { if ((xvar < x) && (yvar == y)) { str = " "; } if ((xvar == x) && (yvar == y)) { str = "O"; } if ((xvar < xx) && (yvar == yy)) { str = " "; } if ((xvar == xx) && (yvar == yy)) { str = "o"; } } xvar+=1; cout << str; str = ""; } xvar = 0; yvar+=1; cout << "\n"; str = ""; } //up to here if(GetAsyncKeyState(VK_A) && 0x41) { if (cana == 0) { if (x > 0) { x-=1; cana = 1; } } } else { cana = 0; } if(GetAsyncKeyState(VK_D) && 0x44) { if (cand == 0) { if (x < 79) { x+=1; cand =1; } } } else { cand = 0; } if(GetAsyncKeyState(VK_W) && 0x57) { if (canw == 0) { if (y > 0) { y-=1; canw = 1; } } } else { canw = 0; } if(GetAsyncKeyState(VK_S) && 0x53) { if (cans == 0) { if (y < 24) { y+=1; cans = 1; } } } else { cans = 0; } str = ""; str2 = ""; system("cls"); } while (caca == 0); return 0; } |
| QUOTE (aaron7215 @ May 20 2005, 08:57 PM) |
| ? I Commented it, I don't know what you mean by indented, but I will try. |
| CODE |
| int main() { cout << "Hello World!" << endl; system("pause"); return 0; } |
| CODE |
| int main() { cout << "Hello World!" << endl; system("pause"); return 0; } |