From 41c4fb3e2b04e10aca9ad3e52cf706721ade0984 Mon Sep 17 00:00:00 2001 From: Ramon Torres Date: Fri, 26 Jul 2024 19:07:44 -0500 Subject: [PATCH] added how i would call the files to fill arrays --- src/main/java/uta/cse3310/Round.java | 55 +++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/src/main/java/uta/cse3310/Round.java b/src/main/java/uta/cse3310/Round.java index 5a053de..0675159 100644 --- a/src/main/java/uta/cse3310/Round.java +++ b/src/main/java/uta/cse3310/Round.java @@ -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 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 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 lettersguessed = new HashSet<>(); + HashSet 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; @@ -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 players, String wordFilePath, String stakeFilePath) throws IOException { this.players = players; this.word = new Word(loadWords(wordFilePath));