package games.nextturn

import java.io.File
import java.lang.RuntimeException

var allWords = setOf<String>()
var commonWords = setOf<String>()

fun main() {
    loadWords()

    println("Available choices:")
    println("[1] Input grades (use as aide)")
    println("[2] Test against random word")
    println("[3] Test against input word")
    println("[4] Find best first guess")
    println("[5] Build cheat sheet")
    println("[6] Test all words")
    print("Enter choice > ")

    val highSelection = 6

    var menuChoice = 0
    while (menuChoice < 1 || menuChoice > highSelection) {
        try {
            menuChoice = readLine()?.toInt() ?: 0
        } catch (ex: Exception) {
            println("Please make a selection between 1 and $highSelection")
        }
    }

    when (menuChoice) {
        1 -> runAide()
        2 -> runTest(null)
        3 -> testAnswer()
        4 -> bestFirstGuess()
        5 -> buildCheatSheet()
        6 -> testAllWords()
    }
}

fun runAide() {
    val remaining = allWords.toMutableSet()

    var tries = 0
    var guess = "lares"
    var grade = 1

    while (grade != 0 && remaining.size > 0) {
        println("There are still ${remaining.size} possible words left")

        tries++

        var gradeIn = ""
        println("Guessing $guess")
        while (gradeIn.length != 5 && gradeIn.filter { listOf('.', 'c', 'W').contains(it) }.length != 5) {
            print("  Grade? > ")
            gradeIn = readLine() ?: ""

            if (gradeIn == "p") {
                for (w in remaining) {
                    println(w)
                }
            }

            if (gradeIn.length != 5 && gradeIn.filter { listOf('.', 'c', 'W').contains(it) }.length != 5) {
                println("Grade must be 5 characters. Use '.' for not in answer, 'w' for wrong sport and 'C' for Correct")
            }
        }

        grade = stringToGrade(gradeIn)

        remaining.removeIf { !checkWord(guess, it, grade) }
        guess = bestGuess(remaining)
    }

    println("Word is $guess, took $tries tries")
}

fun runTest(input: String?) {
    val answer = input ?: allWords.random()
    println("Testing for the answer $answer")

    val remaining = allWords.toMutableSet()

    var tries = 1
    var guess = "lares"

    while (guess != answer && remaining.size > 0) {
        tries++
        val grade = gradeWord(guess, answer)
        println("Guessing $guess, scored a ${prettyGrade(grade)}")
        remaining.removeIf { !checkWord(guess, it, grade) }
        println("There are ${remaining.size} potential words left")
        guess = bestGuess(remaining)
    }

    println("Word is $guess, took $tries tries")
}

fun testAnswer() {
    var answer = ""
    while (answer.length != 5 || !allWords.contains(answer)) {
        print("Enter answer > ")
        answer = readLine() ?: ""
        if (answer.length != 5 || !allWords.contains(answer)) {
            println("Please enter a valid 5 letter word")
        }
    }

    runTest(answer)
}

fun bestFirstGuess() {
    val rankedWords = allWords.associateWith { guess ->
        var totalRemaining = 0L
        for (answer in allWords) {
            val grade = gradeWord(guess, answer)
            totalRemaining += allWords.filter { checkWord(guess, it, grade) }.size
        }

        println("$guess scored a ${totalRemaining.toFloat() / allWords.size}")
        File("results.txt").appendText("$guess scored a ${totalRemaining.toFloat() / allWords.size}\n")

        totalRemaining
    }

    println(); println(); println(); println(); println()
    println("RESULTS - ")

    val sorted = rankedWords.toList().sortedBy { it.second }
    for (result in sorted) {
        println("${result.first} - ${result.second.toFloat() / allWords.size}")
        File("sorted.txt").appendText("${result.first} - ${result.second.toFloat() / allWords.size}\n")
    }
}

fun buildCheatSheet() {
    val first = getValidWord()

    for (l1 in 0..2) {
        for (l2 in 0..2) {
            for (l3 in 0..2) {
                for (l4 in 0..2) {
                    for (l5 in 0..2) {
                        val grade = (l1 shl 8) or (l2 shl 6) or (l3 shl 4) or (l4 shl 2) or l5
                        val remaining = allWords.filter { checkWord(first, it, grade) }
                        if (remaining.isNotEmpty()) {
                            val best = bestGuess(remaining = remaining.toSet())
                            println("${prettyGrade(grade)} - $best")
                            File("$first.txt").appendText("${prettyGrade(grade)} - $best\n")
                        }
                    }
                }
            }
        }
    }
}

fun bestGuess(remaining: Set<String>): String {
    var best = ""
    var bestTotal = Long.MAX_VALUE

    for (guess in remaining) {
        var totalRemaining = 0L
        for (answer in remaining) {
            val grade = gradeWord(guess, answer)
            totalRemaining += remaining.filter { checkWord(guess, it, grade) }.size
            if (totalRemaining > bestTotal)
                break
        }

        if (totalRemaining < bestTotal) {
            bestTotal = totalRemaining
            best = guess
        }
    }

    return best
}

fun prettyGrade(grade: Int): String {
    var retval = ""
    for (i in 8 downTo 0 step 2) {
        retval += when ((grade shr i) and 3) {
            0 -> "C"
            1 -> "w"
            2 -> "."
            else -> throw RuntimeException("Invalid grade sent in")
        }
    }

    return retval
}

fun stringToGrade(input: String): Int {
    if (input.length != 5)
        throw RuntimeException("Invalid grade input")

    var grade = 0

    for (i in input) {
        grade = grade shl 2
        grade += when (i) {
            'C' -> 0
            'w' -> 1
            '.' -> 2
            else -> throw RuntimeException("Invalid grade input")
        }
    }

    return grade
}

fun loadWords() {
    val uncommon = mutableSetOf<String>()
    val common = mutableSetOf<String>()

    File("assets/wordlists/uncommon.txt").forEachLine {
        uncommon.add(it)
    }

    File("assets/wordlists/common.txt").forEachLine {
        common.add(it)
    }

    commonWords = common.toSet()
    allWords = uncommon union common
}

// TODO - This doesn't do repeat letters correctly. Still works, just not optimal
fun gradeWord(guess: String, answer: String) : Int  {
    // Return 5 sets of 2 bits
    //  00 - Correct
    //  01 - Wrong spot
    //  10 - Not in string
    var total = 0
    for (i in 0 until 5) {
        total = total shl 2
        val thisSpot =
            when {
                guess[i] == answer[i] -> 0
                answer.contains(guess[i]) -> 1
                else -> 2
            }
        total += thisSpot
    }

    return total
}

fun checkWord(guess: String, answer: String, grade: Int) : Boolean {
    return gradeWord(guess, answer) == grade
}

fun getValidWord(remaining: Set<String> = allWords): String {
    var word = ""
    while (word.length != 5 || !remaining.contains(word)) {
        print("Enter word > ")
        word = readLine() ?: ""
        if (word.length != 5 || !allWords.contains(word)) {
            println("Please enter a valid 5 letter word")
        }
    }

    return word
}

fun getSecondGuesses(first: String): Map<Int, String> {
    val seconds = mutableMapOf<Int, String>()

    val lines = File("$first.txt").readLines()
    for (line in lines) {
        val grade = stringToGrade(line.substring(0, 5))
        seconds[grade] = line.substring(8, 13)
    }

    return seconds
}

fun testAllWords() {
    val first = getValidWord()
    val seconds = getSecondGuesses(first)

    val totalTries = IntArray(20) { 0 }

    for (answer in allWords) {
        println("Testing for the answer $answer")

        val remaining = allWords.toMutableSet()

        // First guess
        var tries = 1
        var guess = first
        if (answer != guess) {
            val grade = gradeWord(guess, answer)
            remaining.removeIf { !checkWord(guess, it, grade) }
            guess = seconds[grade] ?: throw Exception("Second word not found for ${prettyGrade(grade)}")
            tries++
        }

        while (guess != answer && remaining.size > 0) {
            val grade = gradeWord(guess, answer)
            remaining.removeIf { !checkWord(guess, it, grade) }
            guess = bestGuess(remaining)
            tries++
        }

        totalTries[tries]++
        println("Word is $guess, took $tries tries")
    }

    for (i in 0 until 20) {
        println("Number of words in $i tries: ${totalTries[i]}, ${totalTries[i].toFloat() * 100.0f / allWords.size.toFloat()}%")
    }
}

Compiled from "Comparisons.kt"
public final class games.nextturn.MainKt$bestFirstGuess$$inlined$sortedBy$1<T> implements java.util.Comparator {
  public games.nextturn.MainKt$bestFirstGuess$$inlined$sortedBy$1();
    Code:
       0: aload_0
       1: invokespecial #16                 // Method java/lang/Object."<init>":()V
       4: return

  public final int compare(T, T);
    Code:
       0: aload_1
       1: checkcast     #23                 // class kotlin/Pair
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: invokevirtual #27                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      12: checkcast     #29                 // class java/lang/Long
      15: checkcast     #31                 // class java/lang/Comparable
      18: aload_2
      19: checkcast     #23                 // class kotlin/Pair
      22: astore_3
      23: astore        5
      25: iconst_0
      26: istore        4
      28: aload_3
      29: invokevirtual #27                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      32: checkcast     #29                 // class java/lang/Long
      35: aload         5
      37: swap
      38: checkcast     #31                 // class java/lang/Comparable
      41: invokestatic  #37                 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I
      44: ireturn
}

Compiled from "Main.kt"
public final class games.nextturn.MainKt {
  private static java.util.Set<java.lang.String> allWords;

  private static java.util.Set<java.lang.String> commonWords;

  public static final java.util.Set<java.lang.String> getAllWords();
    Code:
       0: getstatic     #12                 // Field allWords:Ljava/util/Set;
       3: areturn

  public static final void setAllWords(java.util.Set<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #17                 // String <set-?>
       3: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: putstatic     #12                 // Field allWords:Ljava/util/Set;
      10: return

  public static final java.util.Set<java.lang.String> getCommonWords();
    Code:
       0: getstatic     #27                 // Field commonWords:Ljava/util/Set;
       3: areturn

  public static final void setCommonWords(java.util.Set<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #17                 // String <set-?>
       3: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: putstatic     #27                 // Field commonWords:Ljava/util/Set;
      10: return

  public static final void main();
    Code:
       0: invokestatic  #35                 // Method loadWords:()V
       3: ldc           #37                 // String Available choices:
       5: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
       8: swap
       9: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      12: ldc           #51                 // String [1] Input grades (use as aide)
      14: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      17: swap
      18: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      21: ldc           #53                 // String [2] Test against random word
      23: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      26: swap
      27: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      30: ldc           #55                 // String [3] Test against input word
      32: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      35: swap
      36: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      39: ldc           #57                 // String [4] Find best first guess
      41: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      44: swap
      45: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      48: ldc           #59                 // String [5] Build cheat sheet
      50: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      53: swap
      54: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      57: ldc           #61                 // String [6] Test all words
      59: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      62: swap
      63: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      66: ldc           #63                 // String Enter choice >
      68: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      71: swap
      72: invokevirtual #66                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      75: bipush        6
      77: istore_0
      78: iconst_0
      79: istore_1
      80: iload_1
      81: iconst_1
      82: if_icmplt     90
      85: iload_1
      86: iload_0
      87: if_icmple     140
      90: nop
      91: invokestatic  #72                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      94: dup
      95: ifnull        104
      98: invokestatic  #78                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     101: goto          106
     104: pop
     105: iconst_0
     106: istore_1
     107: goto          80
     110: astore_2
     111: new           #80                 // class java/lang/StringBuilder
     114: dup
     115: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     118: ldc           #85                 // String Please make a selection between 1 and
     120: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     123: iload_0
     124: invokevirtual #92                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     127: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     130: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     133: swap
     134: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     137: goto          80
     140: iload_1
     141: tableswitch   { // 1 to 6
                     1: 180
                     2: 186
                     3: 193
                     4: 199
                     5: 205
                     6: 211
               default: 214
          }
     180: invokestatic  #98                 // Method runAide:()V
     183: goto          214
     186: aconst_null
     187: invokestatic  #102                // Method runTest:(Ljava/lang/String;)V
     190: goto          214
     193: invokestatic  #105                // Method testAnswer:()V
     196: goto          214
     199: invokestatic  #108                // Method bestFirstGuess:()V
     202: goto          214
     205: invokestatic  #111                // Method buildCheatSheet:()V
     208: goto          214
     211: invokestatic  #114                // Method testAllWords:()V
     214: return
    Exception table:
       from    to  target type
          90   107   110   Class java/lang/Exception

  public static final void runAide();
    Code:
       0: getstatic     #12                 // Field allWords:Ljava/util/Set;
       3: checkcast     #123                // class java/lang/Iterable
       6: invokestatic  #129                // Method kotlin/collections/CollectionsKt.toMutableSet:(Ljava/lang/Iterable;)Ljava/util/Set;
       9: astore_0
      10: iconst_0
      11: istore_1
      12: new           #131                // class kotlin/jvm/internal/Ref$ObjectRef
      15: dup
      16: invokespecial #132                // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
      19: astore_2
      20: aload_2
      21: ldc           #134                // String lares
      23: putfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      26: new           #140                // class kotlin/jvm/internal/Ref$IntRef
      29: dup
      30: invokespecial #141                // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
      33: astore_3
      34: aload_3
      35: iconst_1
      36: putfield      #143                // Field kotlin/jvm/internal/Ref$IntRef.element:I
      39: aload_3
      40: getfield      #143                // Field kotlin/jvm/internal/Ref$IntRef.element:I
      43: ifeq          567
      46: aload_0
      47: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
      52: ifle          567
      55: new           #80                 // class java/lang/StringBuilder
      58: dup
      59: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
      62: ldc           #151                // String There are still
      64: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      67: aload_0
      68: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
      73: invokevirtual #92                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      76: ldc           #153                // String  possible words left
      78: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      81: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      84: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      87: swap
      88: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      91: iinc          1, 1
      94: ldc           #155                // String
      96: astore        4
      98: new           #80                 // class java/lang/StringBuilder
     101: dup
     102: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     105: ldc           #157                // String Guessing
     107: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     110: aload_2
     111: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     114: checkcast     #121                // class java/lang/String
     117: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     120: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     123: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     126: swap
     127: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     130: aload         4
     132: invokevirtual #160                // Method java/lang/String.length:()I
     135: iconst_5
     136: if_icmpeq     528
     139: aload         4
     141: astore        5
     143: iconst_0
     144: istore        6
     146: aload         5
     148: checkcast     #162                // class java/lang/CharSequence
     151: astore        7
     153: new           #80                 // class java/lang/StringBuilder
     156: dup
     157: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     160: checkcast     #164                // class java/lang/Appendable
     163: astore        8
     165: iconst_0
     166: istore        9
     168: iconst_0
     169: istore        10
     171: aload         7
     173: invokeinterface #165,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     178: istore        11
     180: iload         10
     182: iload         11
     184: if_icmpge     272
     187: aload         7
     189: iload         10
     191: invokeinterface #169,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     196: istore        12
     198: iload         12
     200: istore        13
     202: iconst_0
     203: istore        14
     205: iconst_3
     206: anewarray     #171                // class java/lang/Character
     209: astore        15
     211: aload         15
     213: iconst_0
     214: bipush        46
     216: invokestatic  #175                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     219: aastore
     220: aload         15
     222: iconst_1
     223: bipush        99
     225: invokestatic  #175                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     228: aastore
     229: aload         15
     231: iconst_2
     232: bipush        87
     234: invokestatic  #175                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     237: aastore
     238: aload         15
     240: invokestatic  #179                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     243: iload         13
     245: invokestatic  #175                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     248: invokeinterface #185,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     253: ifeq          266
     256: aload         8
     258: iload         12
     260: invokeinterface #188,  2          // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;
     265: pop
     266: iinc          10, 1
     269: goto          180
     272: aload         8
     274: checkcast     #80                 // class java/lang/StringBuilder
     277: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     280: invokevirtual #160                // Method java/lang/String.length:()I
     283: iconst_5
     284: if_icmpeq     528
     287: ldc           #190                // String   Grade? >
     289: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     292: swap
     293: invokevirtual #66                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
     296: invokestatic  #72                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
     299: dup
     300: ifnonnull     306
     303: pop
     304: ldc           #155                // String
     306: astore        4
     308: aload         4
     310: ldc           #192                // String p
     312: invokestatic  #196                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     315: ifeq          359
     318: aload_0
     319: invokeinterface #200,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     324: astore        5
     326: aload         5
     328: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     333: ifeq          359
     336: aload         5
     338: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     343: checkcast     #121                // class java/lang/String
     346: astore        6
     348: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     351: aload         6
     353: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     356: goto          326
     359: aload         4
     361: invokevirtual #160                // Method java/lang/String.length:()I
     364: iconst_5
     365: if_icmpeq     130
     368: aload         4
     370: astore        5
     372: iconst_0
     373: istore        6
     375: aload         5
     377: checkcast     #162                // class java/lang/CharSequence
     380: astore        7
     382: new           #80                 // class java/lang/StringBuilder
     385: dup
     386: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     389: checkcast     #164                // class java/lang/Appendable
     392: astore        8
     394: iconst_0
     395: istore        9
     397: iconst_0
     398: istore        10
     400: aload         7
     402: invokeinterface #165,  1          // InterfaceMethod java/lang/CharSequence.length:()I
     407: istore        11
     409: iload         10
     411: iload         11
     413: if_icmpge     501
     416: aload         7
     418: iload         10
     420: invokeinterface #169,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
     425: istore        12
     427: iload         12
     429: istore        13
     431: iconst_0
     432: istore        14
     434: iconst_3
     435: anewarray     #171                // class java/lang/Character
     438: astore        15
     440: aload         15
     442: iconst_0
     443: bipush        46
     445: invokestatic  #175                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     448: aastore
     449: aload         15
     451: iconst_1
     452: bipush        99
     454: invokestatic  #175                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     457: aastore
     458: aload         15
     460: iconst_2
     461: bipush        87
     463: invokestatic  #175                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     466: aastore
     467: aload         15
     469: invokestatic  #179                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     472: iload         13
     474: invokestatic  #175                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     477: invokeinterface #185,  2          // InterfaceMethod java/util/List.contains:(Ljava/lang/Object;)Z
     482: ifeq          495
     485: aload         8
     487: iload         12
     489: invokeinterface #188,  2          // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;
     494: pop
     495: iinc          10, 1
     498: goto          409
     501: aload         8
     503: checkcast     #80                 // class java/lang/StringBuilder
     506: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     509: invokevirtual #160                // Method java/lang/String.length:()I
     512: iconst_5
     513: if_icmpeq     130
     516: ldc           #212                // String Grade must be 5 characters. Use \'.\' for not in answer, \'w\' for wrong sport and \'C\' for Correct
     518: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     521: swap
     522: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     525: goto          130
     528: aload_3
     529: aload         4
     531: invokestatic  #215                // Method stringToGrade:(Ljava/lang/String;)I
     534: putfield      #143                // Field kotlin/jvm/internal/Ref$IntRef.element:I
     537: aload_0
     538: aload_2
     539: aload_3
     540: invokedynamic #235,  0            // InvokeDynamic #0:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;Lkotlin/jvm/internal/Ref$IntRef;)Lkotlin/jvm/functions/Function1;
     545: invokedynamic #245,  0            // InvokeDynamic #1:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
     550: invokeinterface #249,  2          // InterfaceMethod java/util/Set.removeIf:(Ljava/util/function/Predicate;)Z
     555: pop
     556: aload_2
     557: aload_0
     558: invokestatic  #253                // Method bestGuess:(Ljava/util/Set;)Ljava/lang/String;
     561: putfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     564: goto          39
     567: new           #80                 // class java/lang/StringBuilder
     570: dup
     571: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     574: ldc           #255                // String Word is
     576: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     579: aload_2
     580: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     583: checkcast     #121                // class java/lang/String
     586: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     589: ldc_w         #257                // String , took
     592: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     595: iload_1
     596: invokevirtual #92                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     599: ldc_w         #259                // String  tries
     602: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     605: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     608: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     611: swap
     612: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     615: return

  public static final void runTest(java.lang.String);
    Code:
       0: aload_0
       1: dup
       2: ifnonnull     24
       5: pop
       6: getstatic     #12                 // Field allWords:Ljava/util/Set;
       9: checkcast     #286                // class java/util/Collection
      12: getstatic     #292                // Field kotlin/random/Random.Default:Lkotlin/random/Random$Default;
      15: checkcast     #288                // class kotlin/random/Random
      18: invokestatic  #296                // Method kotlin/collections/CollectionsKt.random:(Ljava/util/Collection;Lkotlin/random/Random;)Ljava/lang/Object;
      21: checkcast     #121                // class java/lang/String
      24: astore_1
      25: new           #80                 // class java/lang/StringBuilder
      28: dup
      29: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
      32: ldc_w         #298                // String Testing for the answer
      35: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      38: aload_1
      39: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      42: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      45: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      48: swap
      49: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      52: getstatic     #12                 // Field allWords:Ljava/util/Set;
      55: checkcast     #123                // class java/lang/Iterable
      58: invokestatic  #129                // Method kotlin/collections/CollectionsKt.toMutableSet:(Ljava/lang/Iterable;)Ljava/util/Set;
      61: astore_2
      62: iconst_1
      63: istore_3
      64: new           #131                // class kotlin/jvm/internal/Ref$ObjectRef
      67: dup
      68: invokespecial #132                // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
      71: astore        4
      73: aload         4
      75: ldc           #134                // String lares
      77: putfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      80: aload         4
      82: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      85: aload_1
      86: invokestatic  #196                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
      89: ifne          236
      92: aload_2
      93: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
      98: ifle          236
     101: iinc          3, 1
     104: aload         4
     106: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     109: checkcast     #121                // class java/lang/String
     112: aload_1
     113: invokestatic  #302                // Method gradeWord:(Ljava/lang/String;Ljava/lang/String;)I
     116: istore        5
     118: new           #80                 // class java/lang/StringBuilder
     121: dup
     122: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     125: ldc           #157                // String Guessing
     127: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     130: aload         4
     132: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     135: checkcast     #121                // class java/lang/String
     138: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     141: ldc_w         #304                // String , scored a
     144: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     147: iload         5
     149: invokestatic  #308                // Method prettyGrade:(I)Ljava/lang/String;
     152: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     155: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     158: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     161: swap
     162: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     165: aload_2
     166: aload         4
     168: iload         5
     170: invokedynamic #316,  0            // InvokeDynamic #2:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;I)Lkotlin/jvm/functions/Function1;
     175: invokedynamic #321,  0            // InvokeDynamic #3:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
     180: invokeinterface #249,  2          // InterfaceMethod java/util/Set.removeIf:(Ljava/util/function/Predicate;)Z
     185: pop
     186: new           #80                 // class java/lang/StringBuilder
     189: dup
     190: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     193: ldc_w         #323                // String There are
     196: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     199: aload_2
     200: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
     205: invokevirtual #92                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     208: ldc_w         #325                // String  potential words left
     211: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     214: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     217: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     220: swap
     221: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     224: aload         4
     226: aload_2
     227: invokestatic  #253                // Method bestGuess:(Ljava/util/Set;)Ljava/lang/String;
     230: putfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     233: goto          80
     236: new           #80                 // class java/lang/StringBuilder
     239: dup
     240: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     243: ldc           #255                // String Word is
     245: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     248: aload         4
     250: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     253: checkcast     #121                // class java/lang/String
     256: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     259: ldc_w         #257                // String , took
     262: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     265: iload_3
     266: invokevirtual #92                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     269: ldc_w         #259                // String  tries
     272: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     275: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     278: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     281: swap
     282: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     285: return

  public static final void testAnswer();
    Code:
       0: ldc           #155                // String
       2: astore_0
       3: aload_0
       4: invokevirtual #160                // Method java/lang/String.length:()I
       7: iconst_5
       8: if_icmpne     23
      11: getstatic     #12                 // Field allWords:Ljava/util/Set;
      14: aload_0
      15: invokeinterface #328,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      20: ifne          77
      23: ldc_w         #330                // String Enter answer >
      26: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      29: swap
      30: invokevirtual #66                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      33: invokestatic  #72                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      36: dup
      37: ifnonnull     43
      40: pop
      41: ldc           #155                // String
      43: astore_0
      44: aload_0
      45: invokevirtual #160                // Method java/lang/String.length:()I
      48: iconst_5
      49: if_icmpne     64
      52: getstatic     #12                 // Field allWords:Ljava/util/Set;
      55: aload_0
      56: invokeinterface #328,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      61: ifne          3
      64: ldc_w         #332                // String Please enter a valid 5 letter word
      67: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      70: swap
      71: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      74: goto          3
      77: aload_0
      78: invokestatic  #102                // Method runTest:(Ljava/lang/String;)V
      81: return

  public static final void bestFirstGuess();
    Code:
       0: getstatic     #12                 // Field allWords:Ljava/util/Set;
       3: checkcast     #123                // class java/lang/Iterable
       6: astore_1
       7: iconst_0
       8: istore_2
       9: new           #334                // class java/util/LinkedHashMap
      12: dup
      13: aload_1
      14: bipush        10
      16: invokestatic  #338                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      19: invokestatic  #344                // Method kotlin/collections/MapsKt.mapCapacity:(I)I
      22: bipush        16
      24: invokestatic  #350                // Method kotlin/ranges/RangesKt.coerceAtLeast:(II)I
      27: invokespecial #353                // Method java/util/LinkedHashMap."<init>":(I)V
      30: astore_3
      31: aload_1
      32: astore        4
      34: iconst_0
      35: istore        5
      37: aload         4
      39: invokeinterface #354,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      44: astore        6
      46: aload         6
      48: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          374
      56: aload         6
      58: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      63: astore        7
      65: aload_3
      66: checkcast     #356                // class java/util/Map
      69: aload         7
      71: aload         7
      73: checkcast     #121                // class java/lang/String
      76: astore        8
      78: astore        28
      80: astore        27
      82: iconst_0
      83: istore        9
      85: lconst_0
      86: lstore        10
      88: getstatic     #12                 // Field allWords:Ljava/util/Set;
      91: invokeinterface #200,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      96: astore        12
      98: aload         12
     100: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     105: ifeq          250
     108: aload         12
     110: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     115: checkcast     #121                // class java/lang/String
     118: astore        13
     120: aload         8
     122: aload         13
     124: invokestatic  #302                // Method gradeWord:(Ljava/lang/String;Ljava/lang/String;)I
     127: istore        14
     129: lload         10
     131: getstatic     #12                 // Field allWords:Ljava/util/Set;
     134: checkcast     #123                // class java/lang/Iterable
     137: astore        15
     139: lstore        16
     141: iconst_0
     142: istore        18
     144: aload         15
     146: astore        19
     148: new           #358                // class java/util/ArrayList
     151: dup
     152: invokespecial #359                // Method java/util/ArrayList."<init>":()V
     155: checkcast     #286                // class java/util/Collection
     158: astore        20
     160: iconst_0
     161: istore        21
     163: aload         19
     165: invokeinterface #354,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     170: astore        22
     172: aload         22
     174: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     179: ifeq          226
     182: aload         22
     184: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     189: astore        23
     191: aload         23
     193: checkcast     #121                // class java/lang/String
     196: astore        24
     198: iconst_0
     199: istore        25
     201: aload         8
     203: aload         24
     205: iload         14
     207: invokestatic  #363                // Method checkWord:(Ljava/lang/String;Ljava/lang/String;I)Z
     210: ifeq          172
     213: aload         20
     215: aload         23
     217: invokeinterface #366,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     222: pop
     223: goto          172
     226: aload         20
     228: checkcast     #181                // class java/util/List
     231: nop
     232: astore        26
     234: lload         16
     236: aload         26
     238: invokeinterface #367,  1          // InterfaceMethod java/util/List.size:()I
     243: i2l
     244: ladd
     245: lstore        10
     247: goto          98
     250: new           #80                 // class java/lang/StringBuilder
     253: dup
     254: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     257: aload         8
     259: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     262: ldc_w         #369                // String  scored a
     265: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     268: lload         10
     270: l2f
     271: getstatic     #12                 // Field allWords:Ljava/util/Set;
     274: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
     279: i2f
     280: fdiv
     281: invokevirtual #372                // Method java/lang/StringBuilder.append:(F)Ljava/lang/StringBuilder;
     284: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     287: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     290: swap
     291: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     294: new           #374                // class java/io/File
     297: dup
     298: ldc_w         #376                // String results.txt
     301: invokespecial #378                // Method java/io/File."<init>":(Ljava/lang/String;)V
     304: new           #80                 // class java/lang/StringBuilder
     307: dup
     308: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     311: aload         8
     313: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     316: ldc_w         #369                // String  scored a
     319: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     322: lload         10
     324: l2f
     325: getstatic     #12                 // Field allWords:Ljava/util/Set;
     328: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
     333: i2f
     334: fdiv
     335: invokevirtual #372                // Method java/lang/StringBuilder.append:(F)Ljava/lang/StringBuilder;
     338: bipush        10
     340: invokevirtual #381                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     343: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     346: aconst_null
     347: iconst_2
     348: aconst_null
     349: invokestatic  #387                // Method kotlin/io/FilesKt.appendText$default:(Ljava/io/File;Ljava/lang/String;Ljava/nio/charset/Charset;ILjava/lang/Object;)V
     352: lload         10
     354: invokestatic  #392                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     357: astore        29
     359: aload         27
     361: aload         28
     363: aload         29
     365: invokeinterface #396,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     370: pop
     371: goto          46
     374: aload_3
     375: checkcast     #356                // class java/util/Map
     378: nop
     379: astore_0
     380: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     383: invokevirtual #398                // Method java/io/PrintStream.println:()V
     386: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     389: invokevirtual #398                // Method java/io/PrintStream.println:()V
     392: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     395: invokevirtual #398                // Method java/io/PrintStream.println:()V
     398: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     401: invokevirtual #398                // Method java/io/PrintStream.println:()V
     404: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     407: invokevirtual #398                // Method java/io/PrintStream.println:()V
     410: ldc_w         #400                // String RESULTS -
     413: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     416: swap
     417: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     420: aload_0
     421: invokestatic  #404                // Method kotlin/collections/MapsKt.toList:(Ljava/util/Map;)Ljava/util/List;
     424: checkcast     #123                // class java/lang/Iterable
     427: astore_2
     428: iconst_0
     429: istore_3
     430: aload_2
     431: new           #406                // class games/nextturn/MainKt$bestFirstGuess$$inlined$sortedBy$1
     434: dup
     435: invokespecial #407                // Method games/nextturn/MainKt$bestFirstGuess$$inlined$sortedBy$1."<init>":()V
     438: checkcast     #409                // class java/util/Comparator
     441: invokestatic  #413                // Method kotlin/collections/CollectionsKt.sortedWith:(Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/util/List;
     444: astore_1
     445: aload_1
     446: invokeinterface #414,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     451: astore_2
     452: aload_2
     453: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     458: ifeq          602
     461: aload_2
     462: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     467: checkcast     #416                // class kotlin/Pair
     470: astore_3
     471: new           #80                 // class java/lang/StringBuilder
     474: dup
     475: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     478: aload_3
     479: invokevirtual #419                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     482: checkcast     #121                // class java/lang/String
     485: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     488: ldc_w         #421                // String  -
     491: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     494: aload_3
     495: invokevirtual #424                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     498: checkcast     #426                // class java/lang/Number
     501: invokevirtual #430                // Method java/lang/Number.longValue:()J
     504: l2f
     505: getstatic     #12                 // Field allWords:Ljava/util/Set;
     508: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
     513: i2f
     514: fdiv
     515: invokevirtual #372                // Method java/lang/StringBuilder.append:(F)Ljava/lang/StringBuilder;
     518: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     521: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     524: swap
     525: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     528: new           #374                // class java/io/File
     531: dup
     532: ldc_w         #432                // String sorted.txt
     535: invokespecial #378                // Method java/io/File."<init>":(Ljava/lang/String;)V
     538: new           #80                 // class java/lang/StringBuilder
     541: dup
     542: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     545: aload_3
     546: invokevirtual #419                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     549: checkcast     #121                // class java/lang/String
     552: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     555: ldc_w         #421                // String  -
     558: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     561: aload_3
     562: invokevirtual #424                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     565: checkcast     #426                // class java/lang/Number
     568: invokevirtual #430                // Method java/lang/Number.longValue:()J
     571: l2f
     572: getstatic     #12                 // Field allWords:Ljava/util/Set;
     575: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
     580: i2f
     581: fdiv
     582: invokevirtual #372                // Method java/lang/StringBuilder.append:(F)Ljava/lang/StringBuilder;
     585: bipush        10
     587: invokevirtual #381                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     590: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     593: aconst_null
     594: iconst_2
     595: aconst_null
     596: invokestatic  #387                // Method kotlin/io/FilesKt.appendText$default:(Ljava/io/File;Ljava/lang/String;Ljava/nio/charset/Charset;ILjava/lang/Object;)V
     599: goto          452
     602: return

  public static final void buildCheatSheet();
    Code:
       0: aconst_null
       1: iconst_1
       2: aconst_null
       3: invokestatic  #456                // Method getValidWord$default:(Ljava/util/Set;ILjava/lang/Object;)Ljava/lang/String;
       6: astore_0
       7: iconst_0
       8: istore_1
       9: iload_1
      10: iconst_3
      11: if_icmpge     336
      14: iconst_0
      15: istore_2
      16: iload_2
      17: iconst_3
      18: if_icmpge     330
      21: iconst_0
      22: istore_3
      23: iload_3
      24: iconst_3
      25: if_icmpge     324
      28: iconst_0
      29: istore        4
      31: iload         4
      33: iconst_3
      34: if_icmpge     318
      37: iconst_0
      38: istore        5
      40: iload         5
      42: iconst_3
      43: if_icmpge     312
      46: iload_1
      47: bipush        8
      49: ishl
      50: iload_2
      51: bipush        6
      53: ishl
      54: ior
      55: iload_3
      56: iconst_4
      57: ishl
      58: ior
      59: iload         4
      61: iconst_2
      62: ishl
      63: ior
      64: iload         5
      66: ior
      67: istore        6
      69: getstatic     #12                 // Field allWords:Ljava/util/Set;
      72: checkcast     #123                // class java/lang/Iterable
      75: astore        8
      77: iconst_0
      78: istore        9
      80: aload         8
      82: astore        10
      84: new           #358                // class java/util/ArrayList
      87: dup
      88: invokespecial #359                // Method java/util/ArrayList."<init>":()V
      91: checkcast     #286                // class java/util/Collection
      94: astore        11
      96: iconst_0
      97: istore        12
      99: aload         10
     101: invokeinterface #354,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     106: astore        13
     108: aload         13
     110: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     115: ifeq          161
     118: aload         13
     120: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     125: astore        14
     127: aload         14
     129: checkcast     #121                // class java/lang/String
     132: astore        15
     134: iconst_0
     135: istore        16
     137: aload_0
     138: aload         15
     140: iload         6
     142: invokestatic  #363                // Method checkWord:(Ljava/lang/String;Ljava/lang/String;I)Z
     145: ifeq          108
     148: aload         11
     150: aload         14
     152: invokeinterface #366,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     157: pop
     158: goto          108
     161: aload         11
     163: checkcast     #181                // class java/util/List
     166: nop
     167: astore        7
     169: aload         7
     171: checkcast     #286                // class java/util/Collection
     174: invokeinterface #459,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     179: ifne          186
     182: iconst_1
     183: goto          187
     186: iconst_0
     187: ifeq          306
     190: aload         7
     192: checkcast     #123                // class java/lang/Iterable
     195: invokestatic  #462                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     198: invokestatic  #253                // Method bestGuess:(Ljava/util/Set;)Ljava/lang/String;
     201: astore        8
     203: new           #80                 // class java/lang/StringBuilder
     206: dup
     207: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     210: iload         6
     212: invokestatic  #308                // Method prettyGrade:(I)Ljava/lang/String;
     215: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     218: ldc_w         #421                // String  -
     221: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     224: aload         8
     226: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     229: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     232: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     235: swap
     236: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     239: new           #374                // class java/io/File
     242: dup
     243: new           #80                 // class java/lang/StringBuilder
     246: dup
     247: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     250: aload_0
     251: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     254: ldc_w         #464                // String .txt
     257: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     260: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     263: invokespecial #378                // Method java/io/File."<init>":(Ljava/lang/String;)V
     266: new           #80                 // class java/lang/StringBuilder
     269: dup
     270: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     273: iload         6
     275: invokestatic  #308                // Method prettyGrade:(I)Ljava/lang/String;
     278: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     281: ldc_w         #421                // String  -
     284: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     287: aload         8
     289: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     292: bipush        10
     294: invokevirtual #381                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     297: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     300: aconst_null
     301: iconst_2
     302: aconst_null
     303: invokestatic  #387                // Method kotlin/io/FilesKt.appendText$default:(Ljava/io/File;Ljava/lang/String;Ljava/nio/charset/Charset;ILjava/lang/Object;)V
     306: iinc          5, 1
     309: goto          40
     312: iinc          4, 1
     315: goto          31
     318: iinc          3, 1
     321: goto          23
     324: iinc          2, 1
     327: goto          16
     330: iinc          1, 1
     333: goto          9
     336: return

  public static final java.lang.String bestGuess(java.util.Set<java.lang.String>);
    Code:
       0: aload_0
       1: ldc_w         #474                // String remaining
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: ldc           #155                // String
       9: astore_1
      10: ldc2_w        #475                // long 9223372036854775807l
      13: lstore_2
      14: aload_0
      15: invokeinterface #200,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      20: astore        4
      22: aload         4
      24: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      29: ifeq          228
      32: aload         4
      34: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      39: checkcast     #121                // class java/lang/String
      42: astore        5
      44: lconst_0
      45: lstore        6
      47: aload_0
      48: invokeinterface #200,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      53: astore        8
      55: aload         8
      57: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      62: ifeq          212
      65: aload         8
      67: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      72: checkcast     #121                // class java/lang/String
      75: astore        9
      77: aload         5
      79: aload         9
      81: invokestatic  #302                // Method gradeWord:(Ljava/lang/String;Ljava/lang/String;)I
      84: istore        10
      86: lload         6
      88: aload_0
      89: checkcast     #123                // class java/lang/Iterable
      92: astore        11
      94: lstore        20
      96: iconst_0
      97: istore        12
      99: aload         11
     101: astore        13
     103: new           #358                // class java/util/ArrayList
     106: dup
     107: invokespecial #359                // Method java/util/ArrayList."<init>":()V
     110: checkcast     #286                // class java/util/Collection
     113: astore        14
     115: iconst_0
     116: istore        15
     118: aload         13
     120: invokeinterface #354,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     125: astore        16
     127: aload         16
     129: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     134: ifeq          181
     137: aload         16
     139: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     144: astore        17
     146: aload         17
     148: checkcast     #121                // class java/lang/String
     151: astore        18
     153: iconst_0
     154: istore        19
     156: aload         5
     158: aload         18
     160: iload         10
     162: invokestatic  #363                // Method checkWord:(Ljava/lang/String;Ljava/lang/String;I)Z
     165: ifeq          127
     168: aload         14
     170: aload         17
     172: invokeinterface #366,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     177: pop
     178: goto          127
     181: aload         14
     183: checkcast     #181                // class java/util/List
     186: nop
     187: astore        22
     189: lload         20
     191: aload         22
     193: invokeinterface #367,  1          // InterfaceMethod java/util/List.size:()I
     198: i2l
     199: ladd
     200: lstore        6
     202: lload         6
     204: lload_2
     205: lcmp
     206: ifle          55
     209: goto          212
     212: lload         6
     214: lload_2
     215: lcmp
     216: ifge          22
     219: lload         6
     221: lstore_2
     222: aload         5
     224: astore_1
     225: goto          22
     228: aload_1
     229: areturn

  public static final java.lang.String prettyGrade(int);
    Code:
       0: ldc           #155                // String
       2: astore_1
       3: bipush        8
       5: istore_2
       6: bipush        8
       8: iconst_0
       9: bipush        -2
      11: invokestatic  #484                // Method kotlin/internal/ProgressionUtilKt.getProgressionLastElement:(III)I
      14: istore_3
      15: iload_3
      16: iload_2
      17: if_icmpgt     111
      20: new           #80                 // class java/lang/StringBuilder
      23: dup
      24: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
      27: aload_1
      28: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      31: iload_0
      32: iload_2
      33: ishr
      34: iconst_3
      35: iand
      36: tableswitch   { // 0 to 2
                     0: 64
                     1: 70
                     2: 76
               default: 82
          }
      64: ldc_w         #485                // String C
      67: goto          93
      70: ldc_w         #486                // String w
      73: goto          93
      76: ldc_w         #488                // String .
      79: goto          93
      82: new           #490                // class java/lang/RuntimeException
      85: dup
      86: ldc_w         #492                // String Invalid grade sent in
      89: invokespecial #493                // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
      92: athrow
      93: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      96: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      99: astore_1
     100: iload_2
     101: iload_3
     102: if_icmpeq     111
     105: iinc          2, -2
     108: goto          20
     111: aload_1
     112: areturn

  public static final int stringToGrade(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #496                // String input
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: invokevirtual #160                // Method java/lang/String.length:()I
      11: iconst_5
      12: if_icmpeq     26
      15: new           #490                // class java/lang/RuntimeException
      18: dup
      19: ldc_w         #498                // String Invalid grade input
      22: invokespecial #493                // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
      25: athrow
      26: iconst_0
      27: istore_1
      28: iconst_0
      29: istore_2
      30: aload_0
      31: invokevirtual #160                // Method java/lang/String.length:()I
      34: istore_3
      35: iload_2
      36: iload_3
      37: if_icmpge     119
      40: aload_0
      41: iload_2
      42: invokevirtual #499                // Method java/lang/String.charAt:(I)C
      45: istore        4
      47: iload_1
      48: iconst_2
      49: ishl
      50: istore_1
      51: iload_1
      52: iload         4
      54: lookupswitch  { // 3
                    46: 96
                    67: 88
                   119: 92
               default: 100
          }
      88: iconst_0
      89: goto          111
      92: iconst_1
      93: goto          111
      96: iconst_2
      97: goto          111
     100: new           #490                // class java/lang/RuntimeException
     103: dup
     104: ldc_w         #498                // String Invalid grade input
     107: invokespecial #493                // Method java/lang/RuntimeException."<init>":(Ljava/lang/String;)V
     110: athrow
     111: iadd
     112: istore_1
     113: iinc          2, 1
     116: goto          35
     119: iload_1
     120: ireturn

  public static final void loadWords();
    Code:
       0: new           #501                // class java/util/LinkedHashSet
       3: dup
       4: invokespecial #502                // Method java/util/LinkedHashSet."<init>":()V
       7: checkcast     #145                // class java/util/Set
      10: astore_0
      11: new           #501                // class java/util/LinkedHashSet
      14: dup
      15: invokespecial #502                // Method java/util/LinkedHashSet."<init>":()V
      18: checkcast     #145                // class java/util/Set
      21: astore_1
      22: new           #374                // class java/io/File
      25: dup
      26: ldc_w         #504                // String assets/wordlists/uncommon.txt
      29: invokespecial #378                // Method java/io/File."<init>":(Ljava/lang/String;)V
      32: aconst_null
      33: aload_0
      34: invokedynamic #514,  0            // InvokeDynamic #4:invoke:(Ljava/util/Set;)Lkotlin/jvm/functions/Function1;
      39: iconst_1
      40: aconst_null
      41: invokestatic  #518                // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
      44: new           #374                // class java/io/File
      47: dup
      48: ldc_w         #520                // String assets/wordlists/common.txt
      51: invokespecial #378                // Method java/io/File."<init>":(Ljava/lang/String;)V
      54: aconst_null
      55: aload_1
      56: invokedynamic #525,  0            // InvokeDynamic #5:invoke:(Ljava/util/Set;)Lkotlin/jvm/functions/Function1;
      61: iconst_1
      62: aconst_null
      63: invokestatic  #518                // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
      66: aload_1
      67: checkcast     #123                // class java/lang/Iterable
      70: invokestatic  #462                // Method kotlin/collections/CollectionsKt.toSet:(Ljava/lang/Iterable;)Ljava/util/Set;
      73: putstatic     #27                 // Field commonWords:Ljava/util/Set;
      76: aload_0
      77: checkcast     #123                // class java/lang/Iterable
      80: aload_1
      81: checkcast     #123                // class java/lang/Iterable
      84: invokestatic  #529                // Method kotlin/collections/CollectionsKt.union:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
      87: putstatic     #12                 // Field allWords:Ljava/util/Set;
      90: return

  public static final int gradeWord(java.lang.String, java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #532                // String guess
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_1
       8: ldc_w         #533                // String answer
      11: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      14: iconst_0
      15: istore_2
      16: iconst_0
      17: istore_3
      18: iload_3
      19: iconst_5
      20: if_icmpge     81
      23: iload_2
      24: iconst_2
      25: ishl
      26: istore_2
      27: nop
      28: aload_0
      29: iload_3
      30: invokevirtual #499                // Method java/lang/String.charAt:(I)C
      33: aload_1
      34: iload_3
      35: invokevirtual #499                // Method java/lang/String.charAt:(I)C
      38: if_icmpne     45
      41: iconst_0
      42: goto          68
      45: aload_1
      46: checkcast     #162                // class java/lang/CharSequence
      49: aload_0
      50: iload_3
      51: invokevirtual #499                // Method java/lang/String.charAt:(I)C
      54: iconst_0
      55: iconst_2
      56: aconst_null
      57: invokestatic  #539                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;CZILjava/lang/Object;)Z
      60: ifeq          67
      63: iconst_1
      64: goto          68
      67: iconst_2
      68: istore        4
      70: iload_2
      71: iload         4
      73: iadd
      74: istore_2
      75: iinc          3, 1
      78: goto          18
      81: iload_2
      82: ireturn

  public static final boolean checkWord(java.lang.String, java.lang.String, int);
    Code:
       0: aload_0
       1: ldc_w         #532                // String guess
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_1
       8: ldc_w         #533                // String answer
      11: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      14: aload_0
      15: aload_1
      16: invokestatic  #302                // Method gradeWord:(Ljava/lang/String;Ljava/lang/String;)I
      19: iload_2
      20: if_icmpne     27
      23: iconst_1
      24: goto          28
      27: iconst_0
      28: ireturn

  public static final java.lang.String getValidWord(java.util.Set<java.lang.String>);
    Code:
       0: aload_0
       1: ldc_w         #474                // String remaining
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: ldc           #155                // String
       9: astore_1
      10: aload_1
      11: invokevirtual #160                // Method java/lang/String.length:()I
      14: iconst_5
      15: if_icmpne     28
      18: aload_0
      19: aload_1
      20: invokeinterface #328,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      25: ifne          82
      28: ldc_w         #544                // String Enter word >
      31: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      34: swap
      35: invokevirtual #66                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      38: invokestatic  #72                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      41: dup
      42: ifnonnull     48
      45: pop
      46: ldc           #155                // String
      48: astore_1
      49: aload_1
      50: invokevirtual #160                // Method java/lang/String.length:()I
      53: iconst_5
      54: if_icmpne     69
      57: getstatic     #12                 // Field allWords:Ljava/util/Set;
      60: aload_1
      61: invokeinterface #328,  2          // InterfaceMethod java/util/Set.contains:(Ljava/lang/Object;)Z
      66: ifne          10
      69: ldc_w         #332                // String Please enter a valid 5 letter word
      72: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      75: swap
      76: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      79: goto          10
      82: aload_1
      83: areturn

  public static java.lang.String getValidWord$default(java.util.Set, int, java.lang.Object);
    Code:
       0: iload_1
       1: iconst_1
       2: iand
       3: ifeq          10
       6: getstatic     #12                 // Field allWords:Ljava/util/Set;
       9: astore_0
      10: aload_0
      11: invokestatic  #547                // Method getValidWord:(Ljava/util/Set;)Ljava/lang/String;
      14: areturn

  public static final java.util.Map<java.lang.Integer, java.lang.String> getSecondGuesses(java.lang.String);
    Code:
       0: aload_0
       1: ldc_w         #551                // String first
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: new           #334                // class java/util/LinkedHashMap
      10: dup
      11: invokespecial #552                // Method java/util/LinkedHashMap."<init>":()V
      14: checkcast     #356                // class java/util/Map
      17: astore_1
      18: new           #374                // class java/io/File
      21: dup
      22: new           #80                 // class java/lang/StringBuilder
      25: dup
      26: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
      29: aload_0
      30: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      33: ldc_w         #464                // String .txt
      36: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      39: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      42: invokespecial #378                // Method java/io/File."<init>":(Ljava/lang/String;)V
      45: aconst_null
      46: iconst_1
      47: aconst_null
      48: invokestatic  #556                // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      51: astore_2
      52: aload_2
      53: invokeinterface #414,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      58: astore_3
      59: aload_3
      60: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      65: ifeq          134
      68: aload_3
      69: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      74: checkcast     #121                // class java/lang/String
      77: astore        4
      79: aload         4
      81: iconst_0
      82: iconst_5
      83: invokevirtual #560                // Method java/lang/String.substring:(II)Ljava/lang/String;
      86: dup
      87: ldc_w         #562                // String substring(...)
      90: invokestatic  #565                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      93: invokestatic  #215                // Method stringToGrade:(Ljava/lang/String;)I
      96: istore        5
      98: iload         5
     100: invokestatic  #568                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     103: astore        6
     105: nop
     106: aload_1
     107: aload         6
     109: aload         4
     111: bipush        8
     113: bipush        13
     115: invokevirtual #560                // Method java/lang/String.substring:(II)Ljava/lang/String;
     118: dup
     119: ldc_w         #562                // String substring(...)
     122: invokestatic  #565                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     125: invokeinterface #396,  3          // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     130: pop
     131: goto          59
     134: aload_1
     135: areturn

  public static final void testAllWords();
    Code:
       0: aconst_null
       1: iconst_1
       2: aconst_null
       3: invokestatic  #456                // Method getValidWord$default:(Ljava/util/Set;ILjava/lang/Object;)Ljava/lang/String;
       6: astore_0
       7: aload_0
       8: invokestatic  #573                // Method getSecondGuesses:(Ljava/lang/String;)Ljava/util/Map;
      11: astore_1
      12: iconst_0
      13: istore_3
      14: bipush        20
      16: newarray       int
      18: astore        4
      20: iload_3
      21: bipush        20
      23: if_icmpge     41
      26: iload_3
      27: istore        5
      29: aload         4
      31: iload         5
      33: iconst_0
      34: iastore
      35: iinc          3, 1
      38: goto          20
      41: aload         4
      43: astore_2
      44: getstatic     #12                 // Field allWords:Ljava/util/Set;
      47: invokeinterface #200,  1          // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
      52: astore_3
      53: aload_3
      54: invokeinterface #206,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      59: ifeq          386
      62: aload_3
      63: invokeinterface #210,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      68: checkcast     #121                // class java/lang/String
      71: astore        4
      73: new           #80                 // class java/lang/StringBuilder
      76: dup
      77: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
      80: ldc_w         #298                // String Testing for the answer
      83: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      86: aload         4
      88: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      91: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      94: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
      97: swap
      98: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     101: getstatic     #12                 // Field allWords:Ljava/util/Set;
     104: checkcast     #123                // class java/lang/Iterable
     107: invokestatic  #129                // Method kotlin/collections/CollectionsKt.toMutableSet:(Ljava/lang/Iterable;)Ljava/util/Set;
     110: astore        5
     112: iconst_1
     113: istore        6
     115: new           #131                // class kotlin/jvm/internal/Ref$ObjectRef
     118: dup
     119: invokespecial #132                // Method kotlin/jvm/internal/Ref$ObjectRef."<init>":()V
     122: astore        7
     124: aload         7
     126: aload_0
     127: putfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     130: aload         4
     132: aload         7
     134: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     137: invokestatic  #196                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     140: ifne          239
     143: aload         7
     145: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     148: checkcast     #121                // class java/lang/String
     151: aload         4
     153: invokestatic  #302                // Method gradeWord:(Ljava/lang/String;Ljava/lang/String;)I
     156: istore        8
     158: aload         5
     160: aload         7
     162: iload         8
     164: invokedynamic #578,  0            // InvokeDynamic #6:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;I)Lkotlin/jvm/functions/Function1;
     169: invokedynamic #583,  0            // InvokeDynamic #7:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
     174: invokeinterface #249,  2          // InterfaceMethod java/util/Set.removeIf:(Ljava/util/function/Predicate;)Z
     179: pop
     180: aload         7
     182: aload_1
     183: iload         8
     185: invokestatic  #568                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     188: invokeinterface #586,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     193: checkcast     #121                // class java/lang/String
     196: dup
     197: ifnonnull     233
     200: pop
     201: new           #32                 // class java/lang/Exception
     204: dup
     205: new           #80                 // class java/lang/StringBuilder
     208: dup
     209: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     212: ldc_w         #588                // String Second word not found for
     215: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     218: iload         8
     220: invokestatic  #308                // Method prettyGrade:(I)Ljava/lang/String;
     223: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     226: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     229: invokespecial #589                // Method java/lang/Exception."<init>":(Ljava/lang/String;)V
     232: athrow
     233: putfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     236: iinc          6, 1
     239: aload         7
     241: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     244: aload         4
     246: invokestatic  #196                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     249: ifne          315
     252: aload         5
     254: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
     259: ifle          315
     262: aload         7
     264: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     267: checkcast     #121                // class java/lang/String
     270: aload         4
     272: invokestatic  #302                // Method gradeWord:(Ljava/lang/String;Ljava/lang/String;)I
     275: istore        8
     277: aload         5
     279: aload         7
     281: iload         8
     283: invokedynamic #594,  0            // InvokeDynamic #8:invoke:(Lkotlin/jvm/internal/Ref$ObjectRef;I)Lkotlin/jvm/functions/Function1;
     288: invokedynamic #599,  0            // InvokeDynamic #9:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
     293: invokeinterface #249,  2          // InterfaceMethod java/util/Set.removeIf:(Ljava/util/function/Predicate;)Z
     298: pop
     299: aload         7
     301: aload         5
     303: invokestatic  #253                // Method bestGuess:(Ljava/util/Set;)Ljava/lang/String;
     306: putfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     309: iinc          6, 1
     312: goto          239
     315: iload         6
     317: istore        8
     319: aload_2
     320: iload         8
     322: iaload
     323: istore        9
     325: aload_2
     326: iload         8
     328: iload         9
     330: iconst_1
     331: iadd
     332: iastore
     333: new           #80                 // class java/lang/StringBuilder
     336: dup
     337: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     340: ldc           #255                // String Word is
     342: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     345: aload         7
     347: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
     350: checkcast     #121                // class java/lang/String
     353: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     356: ldc_w         #257                // String , took
     359: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     362: iload         6
     364: invokevirtual #92                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     367: ldc_w         #259                // String  tries
     370: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     373: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     376: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     379: swap
     380: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     383: goto          53
     386: iconst_0
     387: istore_3
     388: iload_3
     389: bipush        20
     391: if_icmpge     471
     394: new           #80                 // class java/lang/StringBuilder
     397: dup
     398: invokespecial #83                 // Method java/lang/StringBuilder."<init>":()V
     401: ldc_w         #601                // String Number of words in
     404: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     407: iload_3
     408: invokevirtual #92                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     411: ldc_w         #603                // String  tries:
     414: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     417: aload_2
     418: iload_3
     419: iaload
     420: invokevirtual #92                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
     423: ldc_w         #605                // String ,
     426: invokevirtual #89                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     429: aload_2
     430: iload_3
     431: iaload
     432: i2f
     433: ldc_w         #606                // float 100.0f
     436: fmul
     437: getstatic     #12                 // Field allWords:Ljava/util/Set;
     440: invokeinterface #149,  1          // InterfaceMethod java/util/Set.size:()I
     445: i2f
     446: fdiv
     447: invokevirtual #372                // Method java/lang/StringBuilder.append:(F)Ljava/lang/StringBuilder;
     450: bipush        37
     452: invokevirtual #381                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     455: invokevirtual #95                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     458: getstatic     #43                 // Field java/lang/System.out:Ljava/io/PrintStream;
     461: swap
     462: invokevirtual #49                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     465: iinc          3, 1
     468: goto          388
     471: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #612                // Method main:()V
       3: return

  private static final boolean runAide$lambda$2(kotlin.jvm.internal.Ref$ObjectRef, kotlin.jvm.internal.Ref$IntRef, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #615                // String it
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      11: checkcast     #121                // class java/lang/String
      14: aload_2
      15: aload_1
      16: getfield      #143                // Field kotlin/jvm/internal/Ref$IntRef.element:I
      19: invokestatic  #363                // Method checkWord:(Ljava/lang/String;Ljava/lang/String;I)Z
      22: ifne          29
      25: iconst_1
      26: goto          30
      29: iconst_0
      30: ireturn

  private static final boolean runAide$lambda$3(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #621,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #623                // class java/lang/Boolean
      10: invokevirtual #626                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn

  private static final boolean runTest$lambda$4(kotlin.jvm.internal.Ref$ObjectRef, int, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #615                // String it
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      11: checkcast     #121                // class java/lang/String
      14: aload_2
      15: iload_1
      16: invokestatic  #363                // Method checkWord:(Ljava/lang/String;Ljava/lang/String;I)Z
      19: ifne          26
      22: iconst_1
      23: goto          27
      26: iconst_0
      27: ireturn

  private static final boolean runTest$lambda$5(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #621,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #623                // class java/lang/Boolean
      10: invokevirtual #626                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn

  private static final kotlin.Unit loadWords$lambda$11(java.util.Set, java.lang.String);
    Code:
       0: aload_1
       1: ldc_w         #615                // String it
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: aload_1
       9: invokeinterface #630,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
      14: pop
      15: getstatic     #636                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      18: areturn

  private static final kotlin.Unit loadWords$lambda$12(java.util.Set, java.lang.String);
    Code:
       0: aload_1
       1: ldc_w         #615                // String it
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: aload_1
       9: invokeinterface #630,  2          // InterfaceMethod java/util/Set.add:(Ljava/lang/Object;)Z
      14: pop
      15: getstatic     #636                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      18: areturn

  private static final boolean testAllWords$lambda$13(kotlin.jvm.internal.Ref$ObjectRef, int, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #615                // String it
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      11: checkcast     #121                // class java/lang/String
      14: aload_2
      15: iload_1
      16: invokestatic  #363                // Method checkWord:(Ljava/lang/String;Ljava/lang/String;I)Z
      19: ifne          26
      22: iconst_1
      23: goto          27
      26: iconst_0
      27: ireturn

  private static final boolean testAllWords$lambda$14(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #621,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #623                // class java/lang/Boolean
      10: invokevirtual #626                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn

  private static final boolean testAllWords$lambda$15(kotlin.jvm.internal.Ref$ObjectRef, int, java.lang.String);
    Code:
       0: aload_2
       1: ldc_w         #615                // String it
       4: invokestatic  #23                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       7: aload_0
       8: getfield      #138                // Field kotlin/jvm/internal/Ref$ObjectRef.element:Ljava/lang/Object;
      11: checkcast     #121                // class java/lang/String
      14: aload_2
      15: iload_1
      16: invokestatic  #363                // Method checkWord:(Ljava/lang/String;Ljava/lang/String;I)Z
      19: ifne          26
      22: iconst_1
      23: goto          27
      26: iconst_0
      27: ireturn

  private static final boolean testAllWords$lambda$16(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #621,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #623                // class java/lang/Boolean
      10: invokevirtual #626                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn

  static {};
    Code:
       0: invokestatic  #644                // Method kotlin/collections/SetsKt.emptySet:()Ljava/util/Set;
       3: putstatic     #12                 // Field allWords:Ljava/util/Set;
       6: invokestatic  #644                // Method kotlin/collections/SetsKt.emptySet:()Ljava/util/Set;
       9: putstatic     #27                 // Field commonWords:Ljava/util/Set;
      12: return
}