#include #include #include #include #include #include void printTable(int , int , char**); //wyswietla tablice Matrixa void moveRovs (int , int , char**); //opadanie rzedow void randomFirstRov (int , int , char**); //losowo wypelnia pierwszy rzad void showWord (int , int , char**, char*, int); char rnd (); //losuje znak z tablicy ASCII void MatrixG(int ,int ,char**); int main(int count, char** args) { int x, y; //x=ilosc kolumn, y= ilosc wierszy char** Matrix; srand(time(NULL)); if(count==3) { x = atoi(args[1]); y = atoi(args[2]); } else { printf("Podaj ilosc kolumn i ilosc wierszy"); scanf("%d %d", &x, &y); } //alokacja pamieci dla Matrixa Matrix = (char**) malloc(sizeof(Matrix)*y); for(int i=0; i1; i--) { memcpy(*(Matrix+i-1),*(Matrix+i-2), sizeof(**Matrix)*x); } randomFirstRov(x, y, Matrix); } void randomFirstRov (int x , int y , char** Matrix) { for(int i=0; i1; j--) { memcpy(*(Matrix+j-1),*(Matrix+j-2), sizeof(**Matrix)*x); } } MatrixG(x, y, Matrix); } void MatrixG(int x, int y, char** Matrix) { char letter; while(1 && letter!='t') { system("cls"); printTable(x, y, Matrix); moveRovs(x, y, Matrix); if(kbhit()) { letter=getch(); } system("ping 127.0.0.1 -n 1 > nul"); //for(int i=0; i<100000000; i++){} } char word[] = "teeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeest"; int position; //printf("Podaj slowo"); // scanf("%s", word); printf("podaj pozycje", &position); scanf("%d", &position); showWord(x, y, Matrix, word, position); }