Day 24 of Code: Code Hangman from Scratch!

Поделиться
HTML-код
  • Опубликовано: 24 окт 2024

Комментарии • 50

  • @5k122Y
    @5k122Y 4 года назад +4

    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.

  • @TheSoulCrisis
    @TheSoulCrisis 3 года назад

    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!

  • @ozbekfahri
    @ozbekfahri 4 года назад +1

    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...

    • @subirnetone
      @subirnetone 4 года назад

      Even I'm getting the same error. Have you solved it yet ?

    • @subirnetone
      @subirnetone 4 года назад

      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

    • @baubaudinamo
      @baubaudinamo 4 года назад

      @@subirnetone hey , i did what you say and diddn`t work... any idea?

    • @baubaudinamo
      @baubaudinamo 4 года назад

      Hello, I get the same error. Did you fix it?

  • @YASHPAHALAJANI
    @YASHPAHALAJANI 8 лет назад +1

    Hey,
    what's the advantage of using:
    ArrayList arr=new ArrayList();
    over
    ArrayList arr=new ArrayList();
    ?

    • @alfieALfie27
      @alfieALfie27 8 лет назад +3

      "Purpose of the diamond operator is to simplify instantiation of generic classes"
      stackoverflow.com/questions/16352816/what-is-diamond-operator-in-java

  • @bakshsidhu6306
    @bakshsidhu6306 4 года назад

    how did you get the Hangman application to your desktop?!?

  • @Defense89
    @Defense89 4 года назад

    please could you do one version with java fxml and scene builder ( with controller)

  • @danielpopov199
    @danielpopov199 4 года назад

    Can I do Enum dataset for the words?

  • @grasshopperweb
    @grasshopperweb 6 лет назад +1

    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.

  • @adeshgadekar4626
    @adeshgadekar4626 4 года назад +1

    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

    • @baubaudinamo
      @baubaudinamo 4 года назад

      Hello, I get the same error. Did you fix it?

    • @stefanpetrov6764
      @stefanpetrov6764 10 месяцев назад

      @@baubaudinamo me too LOL did you fixed it ?

  • @агроРедис
    @агроРедис 7 лет назад

    Hm.. When we PlayTurn(), should`t we add our guess in any case instead if our char is in mystery word? 39:49

  • @baubaudinamo
    @baubaudinamo 4 года назад

    I get this exception Exception in thread "main" java.lang.ArithmeticException: / by zero

  • @shobankalia1225
    @shobankalia1225 8 лет назад

    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() )

    • @blondiebytes
      @blondiebytes  8 лет назад

      +Shoban Kalia You're right! Later in the video I fix it :)

    • @shobankalia1225
      @shobankalia1225 8 лет назад

      +Kathryn Hodge thxx for the help

    • @BbXxQQ
      @BbXxQQ 7 лет назад

      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.

  • @SuperQuestion12345
    @SuperQuestion12345 7 лет назад +1

    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."

    • @BigGingerJake
      @BigGingerJake 7 лет назад +3

      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

  • @PTTM6
    @PTTM6 8 лет назад +3

    Please help i need this handed in tomorow and i have no idea how to set it up

    • @johnchambers6771
      @johnchambers6771 6 лет назад +1

      lol same here

    • @SenzoDlomo
      @SenzoDlomo 6 лет назад +4

      2years later, i am facing the same problem, mine is due in 3days from today, i hope you have mastered java by now.

  • @grasshopperweb
    @grasshopperweb 6 лет назад

    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

    • @g0nt4
      @g0nt4 6 лет назад +1

      Just put it in the same folder with the other files.

    • @grasshopperweb
      @grasshopperweb 6 лет назад +1

      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

    • @adeshgadekar4626
      @adeshgadekar4626 4 года назад

      @@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.

    • @grasshopperweb
      @grasshopperweb 4 года назад

      @@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

  • @inertial_salmon
    @inertial_salmon 6 лет назад

    your example word at 28 minutes could be scarab

  • @jacksnipes3934
    @jacksnipes3934 5 лет назад

    How do you download java. I really wanna get it and learn

    • @blondiebytes
      @blondiebytes  5 лет назад

      Check out Day 0 of 30 Days of Code

  • @DavidAnatolie
    @DavidAnatolie 7 лет назад +1

    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.

  • @josephkreifelsii6596
    @josephkreifelsii6596 8 лет назад

    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"

    • @g0nt4
      @g0nt4 6 лет назад

      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

  • @jasonreviews
    @jasonreviews 8 лет назад

    could you do this with html, css, and js? lols.

  • @TheShubham67
    @TheShubham67 4 года назад +1

    Why Java Dear :(

  • @SUPRIYASINGH-rm6nn
    @SUPRIYASINGH-rm6nn 8 лет назад

    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.

    • @blondiebytes
      @blondiebytes  8 лет назад +1

      +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

  • @TheChrisThurman
    @TheChrisThurman 7 лет назад

    My hangman program keeps jumping to 6th try - you lose, after one wrong guess! Any idea why?

  • @Nonsequitor415
    @Nonsequitor415 6 лет назад +1

    ew... Java

  • @Kahweekah2o2f
    @Kahweekah2o2f 6 лет назад +1

    WAIT at 14 min I have to download something??? next video

  • @DarrenSemotiuk
    @DarrenSemotiuk Год назад

    Dictionary.txt File = 404! Dropbox says >>> "This item was deleted"