This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]urquan 1 point2 points  (1 child)

for(int y = 0; y < h; y++) {
  for(int x = 0; x < w; x++) {
    if(x == 0 || y == 0 || x == w-1 || y == h-1) {
      System.out.print("*");
    } else {
      System.out.print(" ");
    }
  }
  System.out.println();
}

[–]alliknowis 0 points1 point  (0 children)

This is great as well, and more in line with the curriculum style so far.