Skip to content
Open

Game #32

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
28 changes: 28 additions & 0 deletions src/main/java/Game/GameLoop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package Game;

import java.util.Scanner;

public class GameLoop {

public GameLoop() {
boolean flag = false;
int counter = 0;
drawHangman(counter);
do{

Scanner input = new Scanner(System.in);
System.out.println("Podaj znak:");
char nextChar = input.next().charAt(0);

String userSentence =

if(machSentence == userSentence){
flag=true;
}else{
counter++;
drawHangman(counter);
}
}while(flag == flase);

}
}
7 changes: 7 additions & 0 deletions src/main/java/pl/edu/agh/hangman/GameRunner.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package pl.edu.agh.hangman;

public class GameRunner {
public void run(){

}
}
4 changes: 4 additions & 0 deletions src/main/java/pl/edu/agh/hangman/Hangman.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package pl.edu.agh.hangman;

import Game.GameLoop;

public class Hangman {

public static final String[] HANGMANPICS = new String[]{
Expand Down Expand Up @@ -55,5 +57,7 @@ public class Hangman {
};

public static void main(String[] args) {
GameRunner runner = new GameRunner();
runner.run();
}
}