private boardPiece[][] pboard = {{new boardPiece(),new boardPiece(),new boardPie
ID: 3557004 • Letter: P
Question
private boardPiece[][] pboard =
{{new boardPiece(),new boardPiece(),new boardPiece(),
new boardPiece(),new boardPiece(),new boardPiece()},
{new boardPiece(),new boardPiece(),new boardPiece(),
new boardPiece(),new boardPiece(),new boardPiece()},
{new boardPiece(),new boardPiece(),new boardPiece(),
new boardPiece(),new boardPiece(),new boardPiece()},
{new boardPiece(),new boardPiece(),new boardPiece(),
new boardPiece(),new boardPiece(),new boardPiece()},
{new boardPiece(),new boardPiece(),new boardPiece(),
new boardPiece(),new boardPiece(),new boardPiece()},
{new boardPiece(),new boardPiece(),new boardPiece(),
new boardPiece(),new boardPiece(),new boardPiece()}};
----------------------------------------------------------------
I believe the array should start something like this:
private boardPiece[][] pboard = new boardPiece[10][10]
Explanation / Answer
import java.util.*;
/* This program implements the word guessing game called Hangman. */
public class Hangman
{
///////////////////////////////////////////////////////////
// 1. CLASS VARIABLE
///////////////////////////////////////////////////////////
private static String[] words = // choose secret word from these
{ "geography", "cat", "yesterday", "java", "truck", "opportunity", "fish
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.