Advertisement
gabbyshimoni

2DarrayToto

May 21st, 2018
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. char toto[3][16];
  2. void setup() {
  3.   Serial.begin(9600);
  4.   for (int i = 0; i < 16; i++) {
  5.     while (Serial.available() == 0);
  6.     char guess = Serial.read();
  7.     if (guess == '1') {
  8.       toto[0][i] = '*'
  9.     }
  10.     if (guess == 'X') {
  11.       toto[1][i] = '*'
  12.     }
  13.     if (guess == '2') {
  14.       toto[2][i] = '*'
  15.     }
  16.   }
  17.   for (int i = 0; i < 3; i++) {
  18.     for (int j = 0; j < 16; j++) {
  19.       if (toto[i][j] == '*') {
  20.         Serial.print("*");
  21.       }
  22.       else {
  23.         Serial.print(" ");
  24.       }
  25.     }
  26.     Serial.println();
  27.   }
  28. }
  29.  
  30. void loop() {
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement