Skip to content
Snippets Groups Projects
Commit 24201f89 authored by fefe's avatar fefe
Browse files

Pushed hangman in project

parent 9a45226f
Branches
Tags
No related merge requests found
File added
public class Hangman {
/*private String currentWord;
private String guessWord;*/
private static String check(String currentWord, String guessWord, char letter){
StringBuilder newStr = new StringBuilder(currentWord);
for ( int i = 0; i < guessWord.length(); i++){
if (guessWord.charAt(i) == letter){
newStr.setCharAt(i, letter);
}
}
return newStr.toString();
}
private static void printHang(int i){
for (int j=0; j < 8; j++){
if(j == 0){
for (int x=0; x < 9; x++){
System.out.print("-");
}
System.out.println("-");
}
if (j > 0){
System.out.print("|");
if (j == 1){
System.out.print("/");
}
if (i > 1){
System.out.print(" |");
}
}
}
}
public static void main(String[] args){
//System.out.println(check("_____","lalaa",'a'));
printHang(2);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment