Hey Just thought I might post some code I've
Been refining its not really useful but it shows (sort of) how to print formatted text if you have any suggestions please I've almost got the kinks out weird numbers will cause it to output weird. But if you throw 9 9 it will print out a nice little square. I did have the kinks worked out but my hard drive died so I lost a lot of good code.
Give me a sec I edit and post id rather not type 55 lines on my Ipod.
Eventually I will add the ability to just use arguements with out having to use the interactive mode.
#include <iostream>
#include <string>
using namespace std;
class DrawRect{
public:
void draw(int x,int y,string ch);
};
void DrawRect::draw(int x,int y,string ch){
int t,r,z;
string c;
t=x;r=y;c=ch;
for(z=0;z!=x; z++){
cout<<c;
}
cout<<endl;
for(int w=0;w!=y;w++){
//inside this loop we create a mini loop to loop "char char"\n
cout<<c;
for(z=0;z!=x-2;z++){
cout<<" ";
}
cout<<c<<endl;
}
for(z=0;z!=x; z++){
cout<<c;
}
}
int main(int argc,char * argv[]){
int x,y;
string ca;
DrawRect r1;
/*if(argc>0){
x=atoi(argv[1]);
y=atoi(argv[2]);
ca=argv[3];
}*/
//else{
cout<<"DrawRect v2.04 rev a\n";
cout<<"Enter X:";
cin>>x;
cout<<"Enter Y:";
cin>>y;
cout<<"Enter a Character to use:";
cin>>ca;
r1.draw(x,y,ca);
cout<<endl;
//}
cin.get();
return 0;
}