//------------------------------------------------------- // Example of how to use params in PbO // // Written by Quinn Hsu // A simple program that writes to STDOUT a T made of // stars given a height and a width //------------------------------------------------------- #include #include using namespace std; ##PARAM (int height); ##PARAM (int width); int main(int args, char** argv) { if (##width%2 != 1) { cout << "width must be an odd number" << endl; exit(-1); } if (##height < 2) { count << "height must be greater than 1" << endl; exit(-1); } int count; for(count=0; count<##width; count++) { cout << "*"; } cout << endl; int inner_count; for(count=1; count<##height; count++) { for(inner_count=0; inner_count<(##width/2); inner_count++) { cout << " "; } cout << "*" << endl; } }