Would like to say you explained this much better than my actual teacher and you helped me finish my homework lol. Great video! 3 years after being posted and your still helping people.
This minigame was more involved than the last but I appreciate this so much! The amount of looping, character handling, and the bit of file reading was really neat and insightful for a few operations. Lots of details but it's sweet how it all comes together, I really REALLY enjoyed this! Thank you for providing this awesome hangman game tutorial!
I'm getting "java.lang.ArithmeticException / by zero" and it points to line 33 and 56 where this code is written in the pickWord method: int wordIndex = Math.abs(rand.nextInt()) % dictionary.size(); Any ide why? Otherwise I followed everything exactly as yours...
It's solved. I'm assuming you are using Windows Operating System. While saving dictionary.txt file, save it with the name dictionary i.e. remove ".txt" extension
"Purpose of the diamond operator is to simplify instantiation of generic classes" stackoverflow.com/questions/16352816/what-is-diamond-operator-in-java
Not a fan of how casually you covered file reading. Definitely could have made the whole video about that. I feel like it's a little complex to just have us write what you write in complete confusion as to how it works.
Hello mam, i am getting error like Exception in thread "main" java.lang.ArithmeticException: / by zero at hangmanapplication.Hangman.pickWord(Hangman.java:48) at hangmanapplication.Hangman.(Hangman.java:25) at hangmanapplication.HangmanApplication.main(HangmanApplication.java:31) please tell me how to fix this
Doubt Regarding File Reader..!! You used the "currentLine != null" as condition for loop (Terminating @ end of file) ..!! But is their any proper function to check if we reached end of file as their exist in C/C++ ( file * fp != eof() )
At end of stream, the following methods: 1)read() returns -1. 2)read(byte[]) returns -1. 3)read(byte[], int, int) returns -1. 4)readLine() returns null. 5)readXXX() for any other X throws EOFException. 6)Scanner.hasNextLine() returns false. 7)Scanner.nextLine() throws NoSuchElementException. As we saw, she used: String currentLine = bufferedFileReader.readLine(); which returns null when reaches the end of stream.
How do I find the Dictionary.txt. File? When I click on link it tells me "That file isn’t here anymore Someone might’ve deleted the file or disabled the link."
Yeah it is not longer in her dropbox. Use the version available on her Github page: github.com/blondiebytes/30-Days-of-Code/blob/master/Video%20Series%20Code/Day%2024/HangmanApplication/dictionary.txt
I know this might be a dead thread but I'm using eclipse and not quite sure where to put my dictionary.txt file. I keep getting the IOException thrown because it can't find it. I currently have it in my src folder in Hangman
yep that's exactly where it was. I figured out the issue but it was a while back so I can't remember exactly what it was now but I do remember that the file was in the right place. :P
@@grasshopperweb Hello sir, I am getting error like Exception in thread main java.lang.AirthmeticException: / by zero at hangmanapplication.Hangman.pickWord(Hangman.java.48) at hangmanapplication.Hangman.(Hangman.java:25) at hangmanapplication.Hangman Application.main(HangmanApplication.java:31) Sir please tell me how to fix this. And also i want to mention that I have downloaded dictionary.txt from github and saved it on my desktop. And i am using eclipse.
@@adeshgadekar4626 you've got a division by zero happening somewhere. Check any locations in the code where you do divisions and think through the logic of what's happening in that piece of code
29:25 I'm still kinda confused about why you chose to use a do-while loop instead of a simple while loop. I mean, I tried using the latter approach, and it worked out just fine - no duplicate code.
What is wrong about caricature? You can always modify the dictionary file yourself or spend a little time in Google. Use this. raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt
Hello Kathryn!May I have you email id please.So that I can ask my doubts regarding hackerrank 30 days of code problems properly.I don't find any mistake in the code even though it is showing wrong ans and even it's not showing any hint about the error in the code.
Would like to say you explained this much better than my actual teacher and you helped me finish my homework lol.
Great video! 3 years after being posted and your still helping people.
This minigame was more involved than the last but I appreciate this so much! The amount of looping, character handling, and the bit of file reading was really neat and insightful for a few operations. Lots of details but it's sweet how it all comes together, I really REALLY enjoyed this! Thank you for providing this awesome hangman game tutorial!
I'm getting "java.lang.ArithmeticException / by zero" and it points to line 33 and 56 where this code is written in the pickWord method:
int wordIndex = Math.abs(rand.nextInt()) % dictionary.size();
Any ide why? Otherwise I followed everything exactly as yours...
Even I'm getting the same error. Have you solved it yet ?
It's solved. I'm assuming you are using Windows Operating System. While saving dictionary.txt file, save it with the name dictionary i.e. remove ".txt" extension
@@subirnetone hey , i did what you say and diddn`t work... any idea?
Hello, I get the same error. Did you fix it?
Hey,
what's the advantage of using:
ArrayList arr=new ArrayList();
over
ArrayList arr=new ArrayList();
?
"Purpose of the diamond operator is to simplify instantiation of generic classes"
stackoverflow.com/questions/16352816/what-is-diamond-operator-in-java
how did you get the Hangman application to your desktop?!?
please could you do one version with java fxml and scene builder ( with controller)
Can I do Enum dataset for the words?
Not a fan of how casually you covered file reading. Definitely could have made the whole video about that. I feel like it's a little complex to just have us write what you write in complete confusion as to how it works.
Hello mam,
i am getting error like
Exception in thread "main" java.lang.ArithmeticException: / by zero
at hangmanapplication.Hangman.pickWord(Hangman.java:48)
at hangmanapplication.Hangman.(Hangman.java:25)
at hangmanapplication.HangmanApplication.main(HangmanApplication.java:31)
please tell me how to fix this
Hello, I get the same error. Did you fix it?
@@baubaudinamo me too LOL did you fixed it ?
Hm.. When we PlayTurn(), should`t we add our guess in any case instead if our char is in mystery word? 39:49
I get this exception Exception in thread "main" java.lang.ArithmeticException: / by zero
Doubt Regarding File Reader..!!
You used the "currentLine != null" as condition for loop (Terminating @ end of file) ..!!
But is their any proper function to check if we reached end of file as their exist in C/C++ ( file * fp != eof() )
+Shoban Kalia You're right! Later in the video I fix it :)
+Kathryn Hodge thxx for the help
At end of stream, the following methods:
1)read() returns -1.
2)read(byte[]) returns -1.
3)read(byte[], int, int) returns -1.
4)readLine() returns null.
5)readXXX() for any other X throws EOFException.
6)Scanner.hasNextLine() returns false.
7)Scanner.nextLine() throws NoSuchElementException.
As we saw, she used: String currentLine = bufferedFileReader.readLine();
which returns null when reaches the end of stream.
How do I find the Dictionary.txt. File? When I click on link it tells me "That file isn’t here anymore
Someone might’ve deleted the file or disabled the link."
Yeah it is not longer in her dropbox. Use the version available on her Github page: github.com/blondiebytes/30-Days-of-Code/blob/master/Video%20Series%20Code/Day%2024/HangmanApplication/dictionary.txt
Please help i need this handed in tomorow and i have no idea how to set it up
lol same here
2years later, i am facing the same problem, mine is due in 3days from today, i hope you have mastered java by now.
I know this might be a dead thread but I'm using eclipse and not quite sure where to put my dictionary.txt file. I keep getting the IOException thrown because it can't find it. I currently have it in my src folder in Hangman
Just put it in the same folder with the other files.
yep that's exactly where it was. I figured out the issue but it was a while back so I can't remember exactly what it was now but I do remember that the file was in the right place. :P
@@grasshopperweb Hello sir,
I am getting error like
Exception in thread main java.lang.AirthmeticException: / by zero
at hangmanapplication.Hangman.pickWord(Hangman.java.48)
at hangmanapplication.Hangman.(Hangman.java:25)
at hangmanapplication.Hangman Application.main(HangmanApplication.java:31)
Sir please tell me how to fix this.
And also i want to mention that I have downloaded dictionary.txt from github and saved it on my desktop. And i am using eclipse.
@@adeshgadekar4626 you've got a division by zero happening somewhere. Check any locations in the code where you do divisions and think through the logic of what's happening in that piece of code
your example word at 28 minutes could be scarab
How do you download java. I really wanna get it and learn
Check out Day 0 of 30 Days of Code
29:25 I'm still kinda confused about why you chose to use a do-while loop instead of a simple while loop. I mean, I tried using the latter approach, and it worked out just fine - no duplicate code.
You should have chosen a better dictionary text file.... Mine had the word "ut" in it.
And I don't know what to say about "caricature"
What is wrong about caricature? You can always modify the dictionary file yourself or spend a little time in Google. Use this. raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt
could you do this with html, css, and js? lols.
yes you can, esp. with javascript
Why Java Dear :(
Hello Kathryn!May I have you email id please.So that I can ask my doubts regarding hackerrank 30 days of code problems properly.I don't find any mistake in the code even though it is showing wrong ans and even it's not showing any hint about the error in the code.
+SUPRIYA SINGH Try posting in the HackerRank discussions, but if you don't get a response within a day or two, email me at blondiebytes@gmail.com
My hangman program keeps jumping to 6th try - you lose, after one wrong guess! Any idea why?
Did you follow this tutorial?
ew... Java
WAIT at 14 min I have to download something??? next video
Dictionary.txt File = 404! Dropbox says >>> "This item was deleted"