Facebook
From Roihaaan Ramadhani, 5 Months ago, written in C++.
Embed
Download Paste or View Raw
Hits: 130
  1. #include <iostream>
  2. #include <cmath>
  3. #include <cctype>
  4. using namespace std;
  5.  
  6. void printCharacter(char character) {
  7.  for (int y = 0; y < 10; y++)
  8.  {
  9.   for (int x = 1; x < 10; x++)
  10.   {
  11.    if (toupper(character) == 'R' && ((x <= 2) || (y == 0 && x <= 7) || (y > 0 && y < 4 && x > 6 && x < 10 - abs(2 - y)) || (y == 4 && (x > 5 & x < 8)) || ((x + 2 == y || x + 1 == y || x == y) && y > 4))) cout << "R";
  12.    else if (toupper(character) == 'O' && (((y > 0 && y < 9) && (x < 3 || x > 7)) || ((x > 1 && x < 9) && (y < 2 || y > 7)))) cout << "O";
  13.    else if (toupper(character) == 'I' && ((x > 3 && x < 7) || ((y == 0 || y == 9) && (x > 1 && x < 9)))) cout << "I";
  14.    else if (toupper(character) == 'H' && ((x < 3 || x > 7) || y == 4 || y == 5)) cout << "H";
  15.    else if (toupper(character) == 'A' && (((x < 3 || x > 7) && y > 4) || (x == 5 && y == 0) || (y > 0 && y < 5 && ((x > 4 - y && x < 7 - y) || (x > 3 + y && x < 6 + y)) || (y > 4 && y < 7)))) cout << "A";
  16.    else if (toupper(character) == 'N' && ((x < 3 || x > 7) || (x > y - 1 && x < y + 2))) cout << "N";
  17.    else cout << " ";
  18.   }
  19.   cout << endl;
  20.  }
  21.  cout << endl;
  22. }
  23.  
  24. int main() {
  25.  printCharacter('R');
  26.  printCharacter('O');
  27.  printCharacter('I');
  28.  printCharacter('H');
  29.  printCharacter('A');
  30.  printCharacter('N');
  31.  
  32.  return 0;
  33. }