Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <unistd.h>
- #include <windows.h>
- #define i 5
- #define j 50
- using namespace std;
- int main()
- {
- system("color 81");
- cout<<"aperte D \n";
- string mat[5][j];
- char key;
- int l,c,flag = 0,count =0;
- for(l=0;l<5;l++){
- for(c=0;c<j;c++){
- mat[l][c] = "+";
- }
- }
- //def x,y inicial:
- mat[0][1] = "x";
- for(l=0;l<5;l++){
- for(c=0;c<j;c++){
- cout<<mat[l][c];
- }
- if(c == j){
- cout<<"\n";
- }
- }
- for(;;){
- if(GetAsyncKeyState(39) < 0){
- system("cls");
- count += 1;
- mat[0][(1+count) - 1] = "+";
- mat[0][1+count] = "x";
- for(l=0;l<5;l++){
- for(c=0;c<j;c++){
- cout<<mat[l][c];
- }
- if(c == j){
- cout<<"\n";
- }
- }
- sleep(1);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement