]> git.sesse.net Git - remoteglot-book/blobdiff - opening-stats.pl
Reuse the remoteglot library for a new book project.
[remoteglot-book] / opening-stats.pl
diff --git a/opening-stats.pl b/opening-stats.pl
new file mode 100755 (executable)
index 0000000..963b8d6
--- /dev/null
@@ -0,0 +1,17 @@
+#! /usr/bin/perl
+use strict;
+use warnings;
+use CGI;
+use JSON::XS;
+use lib '.';
+use Position;
+require 'ECO.pm';
+
+#ECO::unpersist();
+
+my $cgi = CGI->new;
+my $fen = $ARGV[0];
+my $pos = Position->from_fen($fen);
+my $hex = unpack('H*', $pos->bitpacked_fen);
+system("./binlookup", "./open.mtbl", $hex);
+