File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 11#include < iostream>
22#include < cstdlib>
3+
34#include " time.h"
45
6+ #define CLS " \33 [2J\33 [H"
7+
58
69struct Game {
710 char matrix[20 ][50 ]; // Il campo di gioco
@@ -112,7 +115,7 @@ void updateMatrix(Game &game_) { // Passo per riferimento la variabile di tipo G
112115
113116
114117void printMatrix (Game game_) {
115- system ( " cls " ) ;
118+ std::cout << CLS ;
116119
117120 // Stampo la matrice
118121 for (int i = 0 ; i < 50 ; i++)
@@ -121,7 +124,7 @@ void printMatrix(Game game_) {
121124 for (int i = 0 ; i < 20 ; i++) {
122125 for (int j = 0 ; j < 50 ; j++)
123126 std::cout << game_.matrix [i][j];
124- std::cout << std::endl ;
127+ std::cout << ' \n ' ;
125128 }
126129 for (int i = 0 ; i < 50 ; i++)
127130 std::cout << ' #' ;
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Game game(std::string name) { // Ritorna l'oggetto Game
2727 myGame.zFrames = 0 ;
2828 myGame.zFuel = 0 ; // Quante @ devi ancora usare
2929 srand (time (0 )); // Rende casuale la generazione di numeri casuali con rand()
30+ // std::ios_base::sync_with_stdio(false); // Rende la console non bloccante
3031
3132 // Informazioni
3233 while ((std::cout << " Bonus frequency (period): " ) && (!(std::cin >> myGame.bonusFrequency ))) {
You can’t perform that action at this time.
0 commit comments