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.
}