Code the Hangman Game in Java

Published: 18 June 2020
on channel: CodingWithTim
35,353
550

In this video, I will teach you how to make a hangman game in java.
Thanks for watching the video and please leave a like and subscribe!

*****************************************
The link to the dictionary text file:
http://www.gwicks.net/dictionaries.htm

Download the text version for English
unzip it and the text file is inside the folder

*****************************************
The Function Code:
public static void drawHangman(int l) {
if(l == 6) {
System.out.println("|----------");
System.out.println("|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
}
else if(l == 5) {
System.out.println("|----------");
System.out.println("| O");
System.out.println("|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
}
else if(l == 4) {
System.out.println("|----------");
System.out.println("| O");
System.out.println("| |");
System.out.println("|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
}
else if(l == 3) {
System.out.println("|----------");
System.out.println("| O");
System.out.println("| -|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
}
else if(l == 2) {
System.out.println("|----------");
System.out.println("| O");
System.out.println("| -|-");
System.out.println("|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
}
else if(l == 1) {
System.out.println("|----------");
System.out.println("| O");
System.out.println("| -|-");
System.out.println("| /");
System.out.println("|");
System.out.println("|");
System.out.println("|");
}
else{
System.out.println("|----------");
System.out.println("| O");
System.out.println("| -|-");
System.out.println("| /|");
System.out.println("|");
System.out.println("|");
System.out.println("|");
}
}


On this page of the site you can watch the video online Code the Hangman Game in Java with a duration of hours minute second in good quality, which was uploaded by the user CodingWithTim 18 June 2020, share the link with friends and acquaintances, this video has already been watched 35,353 times on youtube and it was liked by 550 viewers. Enjoy your viewing!