So clearly I am not familiar with java, I am having problems with the variables the problem is that I cannot change the value of the row and column and the elements are not adding in the ArrayList here id the code. these is how I declared my variable.
// variables to be used
public int row ,col;
public char[][] board;
public ArrayList<String> converted_board;
public ArrayList<String> toUseWords;
public ArrayList<String> toUseDescription;
public ArrayList<String> inUse = new ArrayList<>();
public Random randomizer = new Random();
// Create instances of categories
private Words easyCategory = new Words(easyLetterWord, easyDescription);
private Words normalCategory = new Words(normalLetterWord, normalDescription);
private Words hardCategory = new Words(hardLetterWord, hardDescription);
this is the my problem
// get game mode easy = 4, normal = 5, hard = 6 letters
if (gameMode.toLowerCase() == "easy mode") {
row = 8;
col = 4;
toUseWords = getToUseWords(easyCategory.getWord(), toUseWords, inUse, row);
toUseDescription = getWordDefinitions(easyCategory.getWord(), toUseWords, easyCategory.getDesription());
}
else if (gameMode.toLowerCase() == "normal mode"){
row = 6;
col = 5;
toUseWords = getToUseWords(normalCategory.getWord(), toUseWords, inUse, row);
toUseDescription = getWordDefinitions(normalCategory.getWord(), toUseWords, normalCategory.getDesription());
}
else if (gameMode.toLowerCase() == "hard mode"){
row = 6;
col = 6;
toUseWords = getToUseWords(hardCategory.getWord(), toUseWords, inUse, row);
toUseDescription = getWordDefinitions(hardCategory.getWord(), toUseWords, hardCategory.getDesription());
//convert 2D array to 1D array to be passed in in the adapter
// converted_board = board_convert(board);
// for debugging purposes
description_display.setText(String.valueOf(row));
somehow the output is 0 when I try to display the row and the sizes of the ArrayList in the textview