Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void outputStarData(char array[][]) {
- int arrRow = array.length;
- int arrCol = array[0].length;
- arrRow = arrRow * 2 + 1;
- arrCol = arrCol * 2 + 1;
- int row = 0;
- int col = 0;
- for (int i = 0; i < arrRow; i++) {
- for (int j = 0; j < arrCol; j++) {
- if (i % 2 == 0) {
- System.out.print("-");
- } else {
- if (j % 2 == 0) {
- System.out.print("|");
- } else {
- row = (i - 1) / 2;
- col = (j - 1) / 2;
- System.out.print(array[row][col]);
- }
- }
- }
- System.out.print("\n");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement