//------------------------------------------------------- // 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 //------------------------------------------------------- public class StarT { ##PARAM (int height) ##PARAM (int width) public static void main(String args[]) { if (##width%2 != 1) { System.out.println("width must be an odd number\n"); System.exit(-1); } if (##height < 2) { System.out.println("height must be greater than 1\n"); System.exit(-1); } for(int count=0; count<##width; count++) { System.out.print("*"); } System.out.println(); for(int count=1; count<##height; count++) { for(int inner_count=0; inner_count<(##width/2); inner_count++) { System.out.print(" "); } System.out.println("*"); } } }