Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test;
- import java.util.ArrayList;
- import lib.TextIO;
- public class Test {
- public static ArrayList<String> allLetters = new ArrayList<String>();
- public static String userWord, userGuess;
- public static void main(String[] args) {
- System.out.println("userWord");
- userWord = TextIO.getlnString().toUpperCase();
- boolean game = true;
- while (game == true) {
- System.out.println("userGuess");
- userGuess = TextIO.getlnString().toUpperCase();
- allLetters.add(userGuess);
- test();
- }
- }
- public static void test() {
- for (int i = 0; i < userWord.length(); i++) {
- for (String t2heke : allLetters) {
- if (t2heke.equals(Character.toString(userWord.charAt(i)))) {
- System.out.print(t2heke.toUpperCase() + " ");
- } else {
- System.out.print("_ ");
- }
- }
- }
- TextIO.putln();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement