diff --git a/.travis.yml b/.travis.yml
index 962bba1..e69de29 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +0,0 @@
-language: java
-jdk: openjdk8
-after_success:
- - mvn coveralls:report
\ No newline at end of file
diff --git a/java/.vscode/settings.json b/java/.vscode/settings.json
new file mode 100644
index 0000000..47f172f
--- /dev/null
+++ b/java/.vscode/settings.json
@@ -0,0 +1,4 @@
+{
+ "java.project.sourcePaths": ["src/main/java"],
+ "java.project.outputPath": "target/classes"
+}
diff --git a/java/pom.xml b/java/pom.xml
index 963bccc..4a888b7 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -11,47 +11,33 @@
11
11
+ 5.7.0
+ 2.12.3
+
org.apache.maven.plugins
maven-compiler-plugin
- 3.8.0
+ 3.8.1
11
+
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
-
- junit
- junit
- 4.12
- test
-
+
junit
junit
4.12
test
-
- junit
- junit
- 4.12
- test
-
-
-
-
+
org.junit.jupiter
junit-jupiter-params
@@ -59,7 +45,7 @@
test
-
+
org.junit.vintage
junit-vintage-engine
@@ -67,14 +53,12 @@
test
-
+
com.fasterxml.jackson.core
jackson-databind
${jackson.version}
-
-
diff --git a/java/src/main/java/com/github/zipcodewilmington/Console.java b/java/src/main/java/com/github/zipcodewilmington/Console.java
new file mode 100644
index 0000000..c61149f
--- /dev/null
+++ b/java/src/main/java/com/github/zipcodewilmington/Console.java
@@ -0,0 +1 @@
+package main.java.com.github.zipcodewilmington;
diff --git a/java/src/main/java/com/github/zipcodewilmington/WordGuess.java b/java/src/main/java/com/github/zipcodewilmington/WordGuess.java
index 6f5485f..67da60f 100644
--- a/java/src/main/java/com/github/zipcodewilmington/WordGuess.java
+++ b/java/src/main/java/com/github/zipcodewilmington/WordGuess.java
@@ -1,8 +1,176 @@
package com.github.zipcodewilmington;
-/**
- * @author xt0fer
- * @version 1.0.0
- * @date 5/27/21 11:02 AM
- */
-public class WordGuess {}
+// @author mahala
+// @version 2.0.0
+
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+import java.util.Scanner;
+
+public class WordGuess {
+
+ private static final int MAX_TRIES = 6;
+
+ // instance variables
+ private String[] words = loadWords();
+ private char[] secretWord;
+ private char[] guesses;
+ private int triesLeft;
+ private boolean wordGuessed;
+
+ private Scanner scanner = new Scanner(System.in);
+ private Random random = new Random();
+
+ private String[] loadWords() {
+ try {
+ InputStream is = getClass().getClassLoader().getResourceAsStream("words.txt");
+ if (is == null) throw new RuntimeException("words.txt not found");
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is));
+ List list = new ArrayList<>();
+ String line;
+ while ((line = reader.readLine()) != null) {
+ line = line.trim();
+ if (!line.isEmpty()) list.add(line);
+ }
+ return list.toArray(new String[0]);
+ } catch (Exception e) {
+ return new String[]{"cat", "dog", "bog", "cut", "hat", "run", "fun", "sun", "big", "dig"};
+ }
+ }
+
+ public WordGuess() {}
+
+ public static void main(String[] args) {
+ WordGuess game = new WordGuess();
+ game.runGame();
+ }
+
+ public void runGame() {
+ announceGame();
+ boolean playAgain = true;
+ while (playAgain) {
+ initializeGameState();
+ wordGuessed = false;
+
+ while (triesLeft > 0 && !wordGuessed) {
+ printCurrentState();
+ char guess = getNextGuess();
+
+ if (guess == '-') {
+ System.out.println("Quitting game.");
+ return;
+ }
+
+ process(guess);
+
+ if (isWordGuessed()) {
+ wordGuessed = true;
+ playerWon();
+ } else {
+ triesLeft--;
+ }
+ }
+
+ if (!wordGuessed) {
+ playerLost();
+ }
+
+ playAgain = askToPlayAgain();
+ }
+ gameOver();
+ }
+
+ public void announceGame() {
+ System.out.println("Let's Play Wordguess version 2.0");
+ }
+
+ public void gameOver() {
+ System.out.println("Game Over.");
+ }
+
+ public void initializeGameState() {
+ String word = words[random.nextInt(words.length)];
+ secretWord = word.toCharArray();
+ guesses = new char[secretWord.length];
+ for (int i = 0; i < guesses.length; i++) {
+ guesses[i] = '_';
+ }
+ triesLeft = MAX_TRIES;
+ }
+
+ public char getNextGuess() {
+ System.out.println("Enter a single character: ");
+ String input = scanner.nextLine().trim();
+ if (input.isEmpty()) return ' ';
+ return input.charAt(0);
+ }
+
+ public boolean isWordGuessed() {
+ for (char c : guesses) {
+ if (c == '_') return false;
+ }
+ return true;
+ }
+
+ public boolean askToPlayAgain() {
+ System.out.println("Would you like to play again? (yes/no) ");
+ String answer = scanner.nextLine().trim().toLowerCase();
+ return answer.equals("yes");
+ }
+
+ public void printCurrentState() {
+ drawHangman(MAX_TRIES - triesLeft);
+ System.out.println("Current Guesses: ");
+ printArray(guesses);
+ System.out.println("You have " + triesLeft + " tries left.");
+ }
+
+ public void drawHangman(int wrong) {
+ String head = wrong >= 1 ? "O" : " ";
+ String body = wrong >= 2 ? "|" : " ";
+ String lArm = wrong >= 3 ? "/" : " ";
+ String rArm = wrong >= 4 ? "\\" : " ";
+ String lLeg = wrong >= 5 ? "/" : " ";
+ String rLeg = wrong >= 6 ? "\\" : " ";
+
+ System.out.println(" _____");
+ System.out.println(" | |");
+ System.out.println(" | " + head);
+ System.out.println(" | " + lArm + body + rArm);
+ System.out.println(" | " + lLeg + " " + rLeg);
+ System.out.println(" |");
+ System.out.println("_|_");
+ }
+
+ public void printArray(char[] a) {
+ for (char c : a) {
+ System.out.print(c + " ");
+ }
+ System.out.println();
+ }
+
+ public void process(char guess) {
+ for (int i = 0; i < secretWord.length; i++) {
+ if (secretWord[i] == guess) {
+ guesses[i] = guess;
+ }
+ }
+ }
+
+ public void playerWon() {
+ System.out.println("**** ****");
+ printArray(guesses);
+ System.out.println("Congratulations, You Won!");
+ }
+
+ public void playerLost() {
+ drawHangman(MAX_TRIES);
+ System.out.println(":-( :-( :-(");
+ System.out.println("You Lost! You ran out of guesses.");
+ System.out.println("The Word is: " + new String(secretWord));
+ }
+}
diff --git a/java/src/main/java/com/github/zipcodewilmington/sample/Person.java b/java/src/main/java/com/github/zipcodewilmington/sample/Person.java
index 48d7e4b..0a8975c 100644
--- a/java/src/main/java/com/github/zipcodewilmington/sample/Person.java
+++ b/java/src/main/java/com/github/zipcodewilmington/sample/Person.java
@@ -1,4 +1,49 @@
package com.github.zipcodewilmington.sample;
-public class Person {
-}
\ No newline at end of file
+public class Person implements PersonInterface {
+
+ private String firstName;
+ private String lastName;
+ private Integer age;
+
+ public Person() {
+ this.firstName = "";
+ this.lastName = "";
+ this.age = 0;
+ }
+
+ @Override
+ public String getFirstName() {
+ return firstName;
+ }
+
+ @Override
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ @Override
+ public String getLastName() {
+ return lastName;
+ }
+
+ @Override
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ @Override
+ public Integer getAge() {
+ return age;
+ }
+
+ @Override
+ public void setAge(Integer age) {
+ this.age = age;
+ }
+
+ @Override
+ public String toString() {
+ return firstName + " " + lastName + ", age " + age;
+ }
+}
diff --git a/java/src/main/resources/words.txt b/java/src/main/resources/words.txt
new file mode 100644
index 0000000..59687f1
--- /dev/null
+++ b/java/src/main/resources/words.txt
@@ -0,0 +1,102 @@
+apple
+brave
+chair
+dance
+eagle
+flame
+grape
+house
+igloo
+juice
+knife
+lemon
+mango
+night
+ocean
+piano
+queen
+river
+storm
+tiger
+umbrella
+violet
+water
+xenon
+yacht
+zebra
+angry
+blaze
+chess
+dizzy
+elite
+frost
+giant
+honey
+ivory
+joker
+karma
+latch
+march
+noble
+olive
+plumb
+quirk
+ridge
+snowy
+talon
+under
+vivid
+waltz
+xeric
+yield
+zonal
+bread
+cloud
+drive
+earth
+fauna
+globe
+haven
+ideal
+jewel
+kneel
+lunar
+magic
+nerve
+ozone
+pearl
+quest
+realm
+snake
+trail
+unity
+vapor
+witch
+xylem
+yearn
+zones
+bluff
+crisp
+dwarf
+elder
+flair
+grasp
+haste
+infer
+joust
+knack
+lofty
+maple
+nudge
+orbit
+prism
+quart
+raven
+shiny
+thyme
+ulcer
+valor
+whirl
+xerox
+young
+zesty
diff --git a/java/src/test/java/com/github/zipcodewilmington/sample/Edited Person Library 1 b/java/src/test/java/com/github/zipcodewilmington/sample/Edited Person Library 1
new file mode 100644
index 0000000..93bb055
--- /dev/null
+++ b/java/src/test/java/com/github/zipcodewilmington/sample/Edited Person Library 1
@@ -0,0 +1,46 @@
+package com.zipcodewilmington.centrallibrary;
+
+public class Person {}
+
+public class Address {
+ //Instance vairables
+ private String street;
+ private String city;
+ private String state;
+ private String zipCode;
+
+ //Defalut Setting
+public Address() {
+ this.street = "";
+ this.city = "";
+ this.state = "";
+ this.zipCode = "";
+ }
+
+ //Parameterized Constructor
+ public Address(String street, String city, String state, String zipCode) {
+ this.street = street;
+ this.city = city;
+ this.state = state;
+ this.zipCode = zipCode;
+ }
+
+ //Getter
+ public String gitStreet() {
+ return street;
+ }
+ public String gitCity() {
+ return city;
+ }
+ public String gitState() {
+ return state;
+ }
+ public String gitZipcode() {
+ return zipCode;
+ }
+ //Override for cleaner view
+ public String AddressString() {
+ return street + ", " + city + ", " + state + ", " + zipCode;
+ }
+}
+
diff --git a/java/src/test/java/com/github/zipcodewilmington/sample/Projects.code-workspace b/java/src/test/java/com/github/zipcodewilmington/sample/Projects.code-workspace
new file mode 100644
index 0000000..5b9efb2
--- /dev/null
+++ b/java/src/test/java/com/github/zipcodewilmington/sample/Projects.code-workspace
@@ -0,0 +1,10 @@
+{
+ "folders": [
+ {
+ "path": "../../../../../../../../.."
+ },
+ {
+ "path": "../../../../../../../../../bluebook1"
+ }
+ ]
+}
\ No newline at end of file