2

I am having problem in rotating my string to 90 degree,-90 degree as well as reflection.I have tried using examples of rotating character from my friend but i am not sure how to place it into my program.Hence, i am planning to see other ways to let my string rotate.Here are my program below:

#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <stdlib.h>

using namespace std ;



void display(string letter, char DataType ) // To display string letter as well as changing the character in my array to other symbols.
{

  char displayboard[20][40];  // The size of my displayboard.
  const int RowI = 20 , ColumnJ = 40 ;
  char board_A[RowI][ColumnJ] =
                       {
                             {' ' , ' ' , DataType , ' ' , ' ' },
                             {' ' , DataType , ' ' , DataType , ' ' },
                             { DataType , ' ' , ' ' , ' ' , DataType },
                             { DataType , ' ' , ' ' , ' ' , DataType },
                             { DataType , DataType , DataType , DataType , DataType },
                             { DataType , ' ' , ' ' , ' ' , DataType },
                             { DataType , ' ' , ' ' ,' '  , DataType }
                        };

    char board_B[RowI][ColumnJ] =
                       {
                             {DataType , DataType , DataType , DataType , ' ' },
                             {DataType , ' ' , ' ' , ' ' , DataType },
                             {DataType , ' ' , ' ' , ' ' , DataType },
                             {DataType , DataType , DataType , DataType , ' ' },
                             {DataType , ' ' , ' ' , ' ' , DataType },
                             {DataType , ' ' , ' ' , ' ' , DataType },
                             {DataType , DataType , DataType ,DataType  , ' ' }
                       };

int main()
{

    string letter ;
    char DataType ;

    string displayboard(int RowI , int ColumnJ , const char A[20][40]) ;

    cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl ;
    cout << "|     Please enter  words or numbers:   |" << endl ;
    cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl ;
    cout << "Insert here =>" ;
    getline(cin , letter);  // To output my string letter from the board.
    cout << endl << endl << endl ;

    cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl ;
    cout << "|       Please enter your symbol:       |" << endl ;
    cout << "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" << endl ;
    cout << "Insert here =>";
    cin >> DataType;
    display( letter, DataType); // To display my character of my string letter.


}
aron13214
  • 27
  • 3
  • This is just a part of my code and for my full code i am using switch case to break the character. – aron13214 Sep 28 '19 at 05:56
  • All I see in your code is output to console. Graphical capabilities of your console (terminal) are probably limited. However, I became curious what the Unicode provides about this and googled "unicode rotate character": [SO: How does uʍop-ǝpᴉsdn text work?](https://stackoverflow.com/q/2995340/7478597). This will, of course, only if 1. your console supports Unicode and 2. the used font has the necessary glyphs for this. I once tried to switch my Windows console to UTF-8 but the output was rather frustrating. – Scheff's Cat Sep 28 '19 at 08:23
  • As I mentioned [Unicode](https://en.wikipedia.org/wiki/Unicode) and [UTF-8](https://en.wikipedia.org/wiki/UTF-8) (which is an encoding of Unicode codepoints with bytes i.e. type `char` can be used to store the strings), this might be helpful as well: [The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)](https://www.joelonsoftware.com/2003/10/08/the-absolute-minimum-every-software-developer-absolutely-positively-must-know-about-unicode-and-character-sets-no-excuses/). (The title may sound scaring but the article is good.) – Scheff's Cat Sep 28 '19 at 08:27

0 Answers0