Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Fixes from Matin Akhamzadeh and Ziliang Zeng #43

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ To use a custom wordlist, use ant argument:
-Darg0="/filename/"

To play either version, start with either a custom or default word list. Then, guess a letter in the word. Proceed in this manner until either you have exhausted your incorrect guesses or completely guessed the word.

#W16 Final Remarks
This program is an electronic version of a hangman game. There are two modes to this game, the first mode being one player against a default list of words in .txt file (you can also create a file to use) and the second mode being a two player mode in which one player inputs a word and the next player has to try and guess the word. This brings us to one of the bugs in the program. An exception class needs to be created for the two player option because if the two player checkbox is even accidentally clicked, a null pointer exception will be thrown by the program because the user failed to input a word to be guessed by the second player (75 points). Another bug inside the two player mode is that once you enter the two player mode and want to go back to one player mode, unchecking the box does not restart the game in one player, however the restart button does, so you have to make sure that once the box is unchecked, the one player mode is automatically reinitialized (150 points). In addition to that, another very minor bug that occurs when the GUI is first initialized through the "ant run" command is that part of the lower panel is cut off upon initialization blocking the "hints left" and "hints allowed" that are supposed to appear on the screen (75 points). This program not only supports single letter guesses, but also full word guesses that are the same length as the mystery word. But, unfortunately, another bug inside the program causes the gallow to not update after an incorrect word is guessed by a player, even though the number of attempts the user has to guess another letter decrements (75 points). An addition to the program that is not necessarily a bug but that would expand the game is a implementation of an online two player mode (200 points).
16 changes: 16 additions & 0 deletions W16_lab10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# lab10, Ziliang Zeng, Matin Akhamzadeh
# Mentor: Arda

* Issue: Create Null Pointer Exception class for initializing two player mode with inputting mystery word https://github.com/UCSB-CS56-Projects/cs56-games-hangman/issues/44 (75 points)

* Issue: Unchecking two player mode should reinitialize game back to one player mode but does not (150 points)
https://github.com/UCSB-CS56-Projects/cs56-games-hangman/issues/45

* Issue: "Hints Left" and "Hints Allowed" are blocked on the screen when GUI is initialized (75 points)
https://github.com/UCSB-CS56-Projects/cs56-games-hangman/issues/46

* Issue: Gallow does not update after a word is guessed (75 points)
https://github.com/UCSB-CS56-Projects/cs56-games-hangman/issues/47

* Issue: Implement online two player mode (200 points)
https://github.com/UCSB-CS56-Projects/cs56-games-hangman/issues/19
39 changes: 17 additions & 22 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
<!-- build.xml for github.com/UCSB-CS56-Projects/cs56-games-hangman
original author: Gyeonghun Lee for CS56, W12
modified by David Borden and Ernesto Cojulun S12
modified by Blake Zimmerman for github W14 -->
modified by Blake Zimmerman for github W14
modified by Ziliang Zeng and Matin Akhamzadeh for CS56, W16 -->

<property environment="env"/> <!-- load the environment variables -->
<property name="webRoot" value="${env.HOME}/public_html/cs56" />
<property name="webBaseUrl" value="http://www.cs.ucsb.edu/~${env.USER}/cs56" />

<property name="propertyPackage" value="edu.ucsb.cs56.projects.games.cs56_games_hangman" />

<property name="mainClassCLI" value="edu.ucsb.cs56.projects.games.cs56_games_hangman.CLIMain" />
<property name="mainClassGUI" value="edu.ucsb.cs56.projects.games.cs56_games_hangman.GUIMain" />

<property name="project" value="cs56-games-hangman" />
<property name="javadocDest" value="${webRoot}/${project}/javadoc" />
<property name="javadocURL" value="${webBaseUrl}/${project}/javadoc" />


<path id="project.class.path">
<pathelement location="build"/>
<pathelement location="lib/junit-4.8.2.jar"/>
</path>

<target name="compile" >
<target name="compile" description="compile the code">
<mkdir dir="build" />
<javac srcdir="src" destdir="build" debug="true" debuglevel="lines,source" includeantruntime ="false">
<classpath refid="project.class.path" />
Expand All @@ -36,16 +36,15 @@
<fileset dir="resources"/>
</copy>


</target>

<target name="run" depends="compile, runGUI-noarg, runGUI-witharg"/>
<target name="run" depends="compile, runGUI-noarg, runGUI-witharg" description="run the hangman GUI version of the game"/>

<target name="runGUI" depends="compile, runGUI-noarg, runGUI-witharg"/>
<target name="runGUI" depends="compile, runGUI-noarg, runGUI-witharg" description="runs the hangman GUI version of the game"/>

<target name="runCLI" depends="compile, runCLI-noarg, runCLI-witharg"/>
<target name="runCLI" depends="compile, runCLI-noarg, runCLI-witharg" description="runs the hangman CLI version of the game"/>

<target name="runGUI-noarg" unless="arg0">
<target name="runGUI-noarg" unless="arg0" description="runs the hangman GUI version of the game with custom words">
<echo>
To run with your own word list file, you can type `ant run -Darg0="YourFileName"`
You can also use "Enter" key instead of clicking a "Submit" button.
Expand All @@ -62,7 +61,7 @@ You can also use "Enter" key instead of clicking a "Submit" button.
</java>
</target>

<target name="runCLI-noarg" unless="arg0">
<target name="runCLI-noarg" unless="arg0" description="runs the hangman CLI version of the game with custom words">
<echo>
To run with your own word list file, you can type `ant run -Darg0="YourFileName"`
You can also use "Enter" key instead of clicking a "Submit" button.
Expand All @@ -80,22 +79,20 @@ You can also use "Enter" key instead of clicking a "Submit" button.
</target>


<target name="clean" >
<delete failonerror="false" verbose="true">
<fileset dir="build" includes="**/*.class"/>
</delete>
<target name="clean" description="delete unnecessary files and directories">
<delete dir="javadoc" quiet="true" />
<delete dir="build" quiet="true"/>
</target>

<target name="test" depends="compile">
<target name="test" depends="compile" description="runs all .java that ends in *Test.java">

<junit haltonerror="no" haltonfailure="no">
<classpath refid="project.class.path" />

<classpath refid="project.class.path" />
<batchtest fork="yes">
<fileset dir="src">
<!-- this will pick up every class with a name ending in Test -->
<include name="**/*Test.java"/>
<include name="**/HangmanGameTest.java"/>
</fileset>
</batchtest>

Expand All @@ -104,7 +101,7 @@ You can also use "Enter" key instead of clicking a "Submit" button.
</junit>
</target>

<target name="javadoc" depends="compile">
<target name="javadoc" depends="compile" description="creates a javadoc of the files">

<delete dir="javadoc" quiet="true" />
<javadoc destdir="javadoc" author="true" version="true" use="true" >
Expand Down Expand Up @@ -132,7 +129,5 @@ You can also use "Enter" key instead of clicking a "Submit" button.
<echo> or if not on CSIL, try file:///${javadocDest}/index.html</echo>

</target>




</project>
Binary file added build/resources/Applause
Binary file not shown.
Binary file added build/resources/BOO.wav
Binary file not shown.
Binary file added build/resources/Glass.aiff
Binary file not shown.
Binary file added build/resources/Sosumi.aiff
Binary file not shown.
Loading