Posts

Showing posts with the label PGN

Chess for Android: version 6.0

I am rolling out version 6.0 of Chess for Android, through the usual Google Play channel . The new features include: Two new sets of chess pieces by Maurizio Monge (who very kindly gave explicit permission) Ability to enable/disable saving engine annotations in the PGN file Opening the draw/resign dialog now requires tapping one king then the other Simpler permission model for "older" Android versions The last change, adding bluetooth and network permissions, is needed so that pre-api23 versions of Android can also connect with electronic chessboards over bluetooth or with remote chess engines over a network socket (the latter is also needed for an upcoming FICS client I am working now). From api23 onward, users can selectively enable or disable such permissions. Pre-api23, however, it was an "all-or-nothing". Changes like this have unfortunately the danger that some users will uninstall, but in the long run I believe I can better serve the full customer ba...

Checkers for Android: Position Setup

Image
I finished a position setup feature for Checkers for Android , similar to what was already in Chess for Android . This feature allows users to copy interesting checker problems from textbooks or other sources and play from there to improve their game. In addition, I added an option to show the square labels to make playing out variants from textbooks a bit easier for players that are less familiar with the numbering scheme. Since I recently also added a feature to export games as PDN, this implied I also had to implement FEN setup for games that do not start from the initial position. An example is shown below (note the FEN tag, and the empty first ply since it is white's move in the given position). [Event "Checkers for Android Game"] [Site "United States"] [Date "2019.01.19"] [White "Checkers for Android"] [Black "Self"] [Result "*"] [PlyCount "0"] [Setup "1"] [FEN "W:W9,K32:B13,K1...

Filtering on ELO

Image
I got a useful suggestion at the talkchess forum  for filtering the ELO rating of players. Rather than allowing individual ranges for white and black, I decided to provide a single range that applies to both the white and black player. In the example below, only games where both players have an ELO rating in the range " 1200-1700 " will be shown. Leaving the lower or upper field empty effectively makes that field unbounded (for " 1200- " means all ELO rating 1200 and above, while " -1700 " means all ELO ratings 1700 and below).

Filtering PGN Games

Image
I have extended the game storage features of Chess for Android with the ability to filter PGN games, which is a useful feature when dealing with larger files. To use this feature, long press the notation window and select Game Storage . From there, you see the usual game storage choices, now extended with Filter Game from SD . After a file has selected, a filter window pops up. Here, you can define a filter involving the white and/or back player, the event, an ECO code, and/or the result of the game. After the file has been loaded, a window prompts all games that match the filter. The user can subsequently decide what game should be loaded into Chess for Android. The new feature should be released very soon!

Viewing application/x-chess-pgn MIME type

Starting with v3.1, Chess for Android registers itself as a viewer for the application/x-chess-pgn MIME type. This implies that when other Android applications request viewing a game in PGN format, Chess for Android, or any other chess program that supports this type, will open the game. I am new to this mechanism, but the following two ways of viewing a game seem to work well. To request viewing a game in PGN format that resides in a file (with proper permissions, so that other applications can read it), simply use the following code sequence: Intent intent = new Intent(Intent.ACTION_VIEW); File file = ... file in pgn format ....; intent.setDataAndType(Uri.fromFile(file), "application/x-chess-pgn"); startActivity(intent); Alternatively, to view a game in PGN format that resides in a String, use the following code sequence (in this case, avoid confusing characters such as ':' in the String format): Intent intent = new Intent(Intent.ACTION_VIEW); String...

Rebel ELO Test Corrections and Results

Image
Running tournaments on diverse test suites gave me more confidence in the correctness of my FEN and PGN parser. This time Chess for Android found bugs in the " Rebel ELO Test ". Positions ELO 30, 121, 170  do not set the castling rights for either black or white properly, even though castling is the first given move (that is, the move the engine is supposed to find when used as a tactical test suite; when used as an opening suite, this move is obviously played right away). The results of (mis)using the corrected test suite as an opening suite in a fast match between the built-in Java engine and Stockfish 2.1 on a Nexus One is shown below.                    1 Stockfish 2.1    +421/  -4/=27 96.13%  434.5/452 2 Chess for Android  +4/-421/=27  3.87%   17.5/452 Here is one of the sparse victories of Chess for Android playing white from a very advantageous position. Nevertheless, I am h...

Chess for Android 2.8

Image
I just released version 2.8 of Chess for Android, available from the Android Market or as direct download . New features include: full PGN support (clipboard import/export, file load/save) improved layout for xlarge screen sizes (api 9 and up) bug fix in draw detection after FEN import To load a game from a file in PGN format, long press the notation window, select "Load Game from SD", and navigate to the file. This opens another window with the actual games in that file. Then select the desired game. Very large PGN files may take a while to download (or even run out of memory), but the idea is that future versions will be able to navigate quickly between successive games. I have tried to make the PGN parser reasonably robust (it accepts sloppy SAN for instance), but certain non-standard constructs are rejected. Please let me know if you encounter bugs though.