# [Java (JDK)], 61 bytes <!-- language-all: lang-java --> (a,b)->b<0||b>29||a>b+2&&a>21||a>30?0:a>20&&(a>29||a>b+1)?2:1; [Try it online!][TIO-jtq7ev0t] [Java (JDK)]: http://jdk.java.net/ [TIO-jtq7ev0t]: https://tio.run/##jZhNT@NIEIbv@RVepIlsESJXt9sfkzGjkXbQIu3uBWkvLAcDCYQNySgxmUGQ387aIQHq6WgYDonLLpx6H7e73u6balkd3Fz@9zSe1sP5qLoYBkcPnSYIRmH7eT2@uu4F7dFk9j0adDqLuqrHF@2Z07PTs@CfL38e/x6UwcN0@P355EPci1e9t6Ho0OjQ6jDRodNhqsNMh7kOC5TBslCXoDBBZYLSBLUJihNUJyhPUJ9BfUbVJz2ERodWh4kOnQ5THWY6zHVYoIwYMctEYYLKBKUJahMUJ6hOUJ6gPoP6NEajuRnNzWhuRnMzmpvR3IzmZjQ3A24G3Ay4GXAz4GbAzYCbATcDbgbcDLgZcLMalNWgrAZlNSirQVkNympQFqAsQFmAsgBlAcoClAUoC1AWoCxAWYCyAJVoMokmk2gyiSaTaDKJJpOATAIyCcgkIJOATAIyCcgkIJOATAIyCcgkIOM0CqdROI3CaRROo3BA4YDCAYUDCgcUDigcUDigcEDhgMIBhQOKVGtPtfZUa0@19hTaU2hPoT2F9hTaU2hPoT2F9hTaU2hPoT2F9kyLzbTYTIvNIDaD2AxiM4jNIDaD2AxiM4jNIDaD2AxiM4jNtbpcq8uhLoe6HOpyqMuhLoe6HOpyqMuhLoe6HOpyqCu0nAJyCsgpIKeAnAJyCsgpIKeAnAJyCsgpIKegxaJHFJpEoUsU2kShTxQaRaFTFFpFoVcUmkWhWxTPLnrGzHNmnjXzvJlnzjx35tkzz595Bs1zaLRoQi8kNENCNyS0Q0I/JDREQkcktERCTyQ0RULzIXQfQvsh9B9CAyJ0IEILIvQgQhMi7PXCZi/s9sJ2L@z3woYv7PjCli9srMLOKmytwt4qbK7C7ipsr8IeJmxiwi4mbGPCPiZsZMJmIewWwnYh7BfChiGck4WTsnBWFk7LwolPOPMJpz7DCcXEOzL0CsVbWsmODL2IMcwwOzL0Oscyw@7I0EuhhBnJjgy9WnLMcDsy9IIqZUa6I0OvuTJmZDsy9LIsZ0buZ1j95ApmFG3GatDpbDdtjo7/Pj7546u3b8MdB2/pLD9f@dDv0/TSCNIr0V147dnrcV7n8CZob2L0Zihv7vBec@8V9d63X3hX3h/n74/R98fXu2NjMxQ223jL2fgyuK3G0/Ckno@nV83gqOZXi@jhKBiVT2HVO48ODs8/xY@P54emeHysDs/3TbdbHRppAxt/jj82QdzthtVLgkSfzUd5eh5wwagaT@7mw0UZDzqj2Tzc7CWWBy4eNN@fyuZ7f7/dXXzoBM3fNqfdeSyb04P2YJPVHm7S1qnjaTVZb05el@2lwZszk/X/vqS2p4Y/vg0v6uFlr7qo76rJm4ujILypllX/rh5P@l/m8@p@0V/U82F1G27flahfTe//quqL63B5cLg8jc/KctLtLk@lObiOou3NS/N63@FkMfzpzde7p798Z8GdXy7EWkr4rK8c9Ufhev@2hRv9Vm7zo@AV4Rrj5gnt7w/U@ZP7RT287c/u6v63ZnDUo3Dv6@YWwYfL9kE1WL/d1UH4wV72guYj6gVXs7q5@O90r/eCe1vDhnv0@iurzvPnqrPjt5qfqGd18zg39YWLaK/3Umxzl9Xq6X8 "Java (JDK) – Try It Online" Returns `0` for invalid games, `1` for valid ongoing games, `2` for valid finished games. Takes the score ordered, with the higher score first. ##Ungolfed (a,b) -> b < 0 // Invalid if either number is negative || b > 29 // Invalid if b over 29 || a > b + 2 && a > 21 // Invalid if a should've already won || a > 30 // Invalid if a over 30 ? 0 // Return 0 if invalid : a > 20 // Can only be a win if a has at least 20 pts && ( a > 29 // If a is 30, a has won || a > b + 1 // Otherwise a needs a 2 pt lead ) ? 2 // Return 2 for a win : 1 // Return 1 otherwise