Tile.java This class represents a single Scrabble tile that will be used in the game. The class must have the following
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Tile.java This class represents a single Scrabble tile that will be used in the game. The class must have the following
Scrabble.java This class represents the Scrabble game in which there are seven randomly selected tiles, and scoring is performed for each possible word (this will be the tougher class to implement). The class must have the following private variables: • tiles (Tile[]) The class must have the following public methods: • public Scrabble() [constructor] o Initialize the Tile array and 'pickup' for random values • public Scrabble(Tile []) [constructor] o Initialize the tile array with the given argument • public String getLetters() o Return a string that is all of the tile characters (for example, "ABFEODL") • public ArrayList<String> getWords() o Create an ArrayList of Strings with n elements. Each element should represent a word that can be created using the current tiles. o The algorithm for this method should reference the provided file CollinsScrabbleWords2019.txt ** do NOT put this file somewhere on your local machine and hardcode the local directory. This will likely cause your tests to fail on GradeScope. Also, do not put it within a folder in the relative path. • public int[] getScores() o Create an int array with n elements. Each element in this list should represent each individual score for each word that can be created using the current tiles. This should be returned in ascending order. • public Boolean equals(Scrabble) o Compare the given Scrabble object from the argument with the 'this' object to see if they are equal (do they have the same tiles?).