Skip to content

Commit

Permalink
added how i would call the files to fill arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
RamonTorresUta committed Jul 27, 2024
1 parent 5d6830a commit 41c4fb3
Showing 1 changed file with 54 additions and 1 deletion.
55 changes: 54 additions & 1 deletion src/main/java/uta/cse3310/Round.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,58 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/*
//MAIN FUNCTION WOULD BE LIKE THIS
public class Main {
public static void main(String[] args)
{
//access to Wordlist file
WordList wordlist = new WordList();
Word words = new Word();
//gathering the words
wordlist.gatherwords();
ArrayList<String> wordsforgame = new ArrayList<>(wordlist.getArrList());//storing the words in a new array list
//printing out the words for verification
for (String word : wordsforgame)
{
System.out.println("word(s) selected: " + word);
}
//gathering letters
HashSet<Character> lettersinword = wordlist.findletters(wordsforgame);
//showing letters
System.out.print("letters to guess: ");
for (char letters : lettersinword)
{
System.out.print(letters);
}
System.err.println();
//simple guessing functionality
HashSet<Character> lettersguessed = new HashSet<>();
HashSet<Character> correctguesses = new HashSet<>();
int i = 17;
Scanner scanner = new Scanner(System.in);
while ( i > 0)
{
System.out.print("Enter a letter: ");
String guess = scanner.next();
char letter = guess.charAt(0);
words.checksolutionandreveal(wordsforgame, letter, lettersinword, lettersguessed, correctguesses);
i--;
}
scanner.close();
}
}
*/

public class Round {
private Word word;
Expand All @@ -13,7 +65,8 @@ public class Round {
private boolean isRoundActive;
private static final int TURN_TIME_LIMIT = 100; // Time limit for each player's turn in seconds
private static final int VOWEL_COST = 50; // Cost for buying a vowel



public Round(List<Player> players, String wordFilePath, String stakeFilePath) throws IOException {
this.players = players;
this.word = new Word(loadWords(wordFilePath));
Expand Down

0 comments on commit 41c4fb3

Please sign in to comment.