ok so I need to use a 2d array to draw a hangman picture for a hangman game. the picture should be something like this
============
|<space>|
|<space>O
|<space>/|\
|<space>/\
|
|
but when i run this code with main. i get this
=
=
=
=
=
=
||
null
null
|
null
null
||
null
null
O
null
null
||
null
/
|
null
null
||
null
null
null
null
null
||
null
null
null
null
null
private void drawHangman(){
int rows = 6;
int cols = 6;
String[][] draw = new String[rows][cols];
for(int n=1; n<rows; n++){//draw hang pole ||
draw[n][0] = "||";
}
for(int r=0; r<cols; r++){//draw hang pole =
draw[0][r]= "=";
}
draw[1][3] = "|";
if (wrong >= 1){//draw head
draw[2][3] = "O";
}
if (wrong >= 2){//draw body
draw[3][3] = "|";
}
if (wrong >= 3){//draw hand
draw[3][2] = "/";
}
if (wrong >= 4){//draw hand
draw[3][4] = "\\";
}
if (wrong >= 5){//draw leg
draw[4][2] = "/";
}
if (wrong == 6){//draw leg
draw[4][4] = "\\";
}
for(int x = 0; x < rows; x++){
for(int y = 0;y < cols; y++){
System.out.println(draw[x][y]);
}
}
}