This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! Files.exists(Path.of("chariot.jar"))) { | |
Files.write(Path.of("chariot.jar"), URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.87/chariot-0.0.87.jar" | |
).toURL().openStream().readAllBytes()); | |
} | |
/env --class-path chariot.jar | |
import java.util.concurrent.atomic.AtomicBoolean; | |
import java.util.function.Consumer; | |
import java.util.prefs.Preferences; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! Files.exists(Path.of("chariot.jar"))) { | |
Files.write(Path.of("chariot.jar"), URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.87/chariot-0.0.87.jar" | |
).toURL().openStream().readAllBytes()); | |
} | |
/env --class-path chariot.jar | |
var auth = chariot.Client.auth( | |
uri -> System.out.println("\nVisit the following URL to grant permission:\n\n" + uri), | |
pkce -> pkce.scope(chariot.Client.Scope.puzzle_read)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String userId = "tors42"; // User to check "Top" 10 worst accuracies for | |
// Optional token (download a bit faster) https://lichess.org/account/oauth/token/create | |
String token = ""; | |
if (! Files.exists(Path.of("chariot.jar"))) { | |
Files.write(Path.of("chariot.jar"), URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.86/chariot-0.0.86.jar" | |
).toURL().openStream().readAllBytes()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! Files.exists(Path.of("chariot.jar"))) { | |
Files.write(Path.of("chariot.jar"), URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.84/chariot-0.0.84.jar" | |
).toURL().openStream().readAllBytes()); | |
} | |
/env --class-path chariot.jar | |
import java.time.LocalTime; | |
import java.util.prefs.Preferences; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! Files.exists(Path.of("chariot.jar"))) { | |
Files.write(Path.of("chariot.jar"), URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.83/chariot-0.0.83.jar" | |
).toURL().openStream().readAllBytes()); | |
} | |
/env --class-path chariot.jar | |
import chariot.Client; | |
import chariot.model.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! Files.exists(Path.of("chariot.jar"))) { | |
Files.write(Path.of("chariot.jar"), URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.82/chariot-0.0.82.jar" | |
).toURL().openStream().readAllBytes()); | |
} | |
/env --class-path chariot.jar | |
import chariot.*; | |
import chariot.Client.*; | |
import chariot.model.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Path inputFile = Path.of("input.pgn"); | |
if (! Files.exists(inputFile)) { | |
System.out.println("Couldn't find input file " + inputFile); | |
return -1; | |
} | |
if (! Files.exists(Path.of("chariot.jar"))) { | |
Files.write(Path.of("chariot.jar"), URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.82/chariot-0.0.82.jar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (! Files.exists(Path.of("chariot.jar"))) { | |
Files.write(Path.of("chariot.jar"), URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.83/chariot-0.0.83.jar" | |
).toURL().openStream().readAllBytes()); | |
} | |
/env --class-path chariot.jar | |
import chariot.Client; | |
import chariot.util.Board; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (Path.of("chariot-0.0.77.jar") instanceof Path chariot | |
&& ! Files.exists(chariot)) { | |
Files.write(chariot, URI.create( | |
"https://repo1.maven.org/maven2/io/github/tors42/chariot/0.0.77/chariot-0.0.77.jar" | |
).toURL().openStream().readAllBytes()); | |
} | |
/env --module-path chariot-0.0.77.jar --add-module chariot | |
import chariot.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.time.*; | |
import java.util.function.Function; | |
import java.util.Comparator; | |
import chariot.model.Enums.Color; | |
import chariot.model.Enums.PerfType; | |
import chariot.model.Game; | |
import chariot.Client; | |
class Games { |