Answers.Body: <p>It's possible to generate mates in 1,2,3 etc with tablebase, but that's probably not what you want. You should understand:</p>
  
  <ul>
  <li>You will need good programming knowledge</li>
  <li>You will need a week generating 6-men tablebase mates</li>
  <li>You will generate too many mates than you can possibly study</li>
  </ul>
  
  <p>If you are confident in programming, you can do this:</p>
  
  <ul>
  <li>Modify the Gaviota tablebase generator (ask the author for source code). Find where it calculates distance-to-mate, if it's one (or two or three), print the position out.</li>
  <li>Modify the Syzygy tablebase generator. Syzygy reports distance-to-zero, so you may need to use online probing (e.g. Nalimov) or an engine.</li>
  <li>Use the public API in <a href="https://syzygy-tables.info" rel="nofollow noreferrer">https://syzygy-tables.info</a>. Start from a randomised position. Use the API result to move your position to mate-in-one.</li>
  </ul>
  
  <p>If you don't have any idea what I'm talking about, generating mate positions with tableabse is not for you. You should:</p>
  
  <ul>
  <li>Buy a book with mate-in-one positions. There is an Android app that can read a chess diagram and convert it to PGN.</li>
  </ul>
  
  <p><strong>EDIT</strong>: You shouldn't generate total random FENs. You should try to generate FENs that either side has an extra rook, queen etc.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-28T12:53:06.773Z
Answers.Text: The API looks like the trick. Any pointers on generating random FENs?
Answers.UserDisplayName: Kale
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-28T13:01:01.357Z
Answers.Text: https://rosettacode.org/wiki/Generate_random_chess_position is a start
Answers.UserDisplayName: Kale
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-29T12:08:06.503Z
Answers.Text: @Kale Yeah, that should work although not very efficient. You should not generate total random FENs. Your FEN will be most likely result in a mate if either side has extra material.
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-29T12:10:16.257Z
Answers.Text: @Kale If you think my answer is sufficient for you to get started, please put a tick and accept it!
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-29T15:22:42.433Z
Answers.Text: Yes, more specifically, I meant random within the limit of X number of pieces.
Answers.UserDisplayName: Kale
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-28T07:41:16.803Z
Answers.LastActivityDate: 2016-12-29T12:11:28.227Z
Answers.LastEditDate: 2016-12-29T12:11:28.227Z
Answers.UserDisplayName: SmallChess
Body: <p>I was trying to find a kid's app for chess that has some incredibly simple problems. However, all the apps I found had rather tricky problems. So I thought I would download 3 piece table bases and use SCID (or grep, if necessary) to create a 3-piece Mate-In-One tablebase PGN. Then just use that in iChess or any other problem app that allows PGN imports.</p>
  <p>Much to my chagrin, the tablebases aren't in PGN format as I expected (and I cant even read them in a text editor. Guess I really misunderstand how these tablebases work).</p>
  <p>Any solutions out there?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-27T21:29:20.763Z
Comments.Text: Tablebases have their own format which aren't human readable. But, would you really need a tablebase for this? Isn't that a bit overkill?
Comments.UserDisplayName: Glorfindel
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-27T21:40:56.217Z
Comments.Text: Just the most direct solution I (thought that) I came up with. How would you go about it (my idea also expanded to 4,5 and 6 piece endgames as appropriate).
Comments.UserDisplayName: Kale
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-28T14:17:36.093Z
Comments.Text: Well, think of a position that is checkmate say with K+R v K, and then move the rook somewhere else. You can probably think of new positions faster than they solve them.
Comments.UserDisplayName: RemcoGerlich
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-28T18:03:02.217Z
Comments.Text: Can't you take any database of real games and search for games that end in mate and then extract the position one move before the last?
Comments.UserDisplayName: user1583209
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-29T12:08:51.547Z
Comments.Text: @user1583209 That would be a better approach. FICS and Lichess has many such games. But we are here to answer the question.
Comments.UserDisplayName: SmallChess
Tags: <engines><database><problems><tablebases>
Title: Generate Simple Mate In 1 From Tablebases (for kids)
ThreadText: # Generate Simple Mate In 1 From Tablebases (for kids)
  
  (Asked by: username_0 on 2016-12-27)
  
  I was trying to find a kid's app for chess that has some incredibly simple problems. However, all the apps I found had rather tricky problems. So I thought I would download 3 piece table bases and use SCID (or grep, if necessary) to create a 3-piece Mate-In-One tablebase PGN. Then just use that in iChess or any other problem app that allows PGN imports.
  
  Much to my chagrin, the tablebases aren't in PGN format as I expected (and I cant even read them in a text editor. Guess I really misunderstand how these tablebases work).
  
  Any solutions out there?
  
  **Tags:** engines, database, problems, tablebases
  
  > **Comments:**
  > **username_1**: Tablebases have their own format which aren't human readable. But, would you really need a tablebase for this? Isn't that a bit overkill?  
  > **username_0**: Just the most direct solution I (thought that) I came up with. How would you go about it (my idea also expanded to 4,5 and 6 piece endgames as appropriate).  
  > **username_2**: Well, think of a position that is checkmate say with K+R v K, and then move the rook somewhere else. You can probably think of new positions faster than they solve them.  
  > **username_3**: Can't you take any database of real games and search for games that end in mate and then extract the position one move before the last?  
  > **username_4**: @username_3 That would be a better approach. FICS and Lichess has many such games. But we are here to answer the question.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_4 on 2016-12-28. Score: 2 | Accepted answer
  
  It's possible to generate mates in 1,2,3 etc with tablebase, but that's probably not what you want. You should understand:
  
  * You will need good programming knowledge
  * You will need a week generating 6-men tablebase mates
  * You will generate too many mates than you can possibly study
  
  If you are confident in programming, you can do this:
  
  * Modify the Gaviota tablebase generator (ask the author for source code). Find where it calculates distance-to-mate, if it's one (or two or three), print the position out.
  * Modify the Syzygy tablebase generator. Syzygy reports distance-to-zero, so you may need to use online probing (e.g. Nalimov) or an engine.
  * Use the public API in <https://syzygy-tables.info>. Start from a randomised position. Use the API result to move your position to mate-in-one.
  
  If you don't have any idea what I'm talking about, generating mate positions with tableabse is not for you. You should:
  
  * Buy a book with mate-in-one positions. There is an Android app that can read a chess diagram and convert it to PGN.
  
  **EDIT**: You shouldn't generate total random FENs. You should try to generate FENs that either side has an extra rook, queen etc.
  
  > **Comments:**
  > **username_0**: The API looks like the trick. Any pointers on generating random FENs?  
  > **username_0**: https://rosettacode.org/wiki/Generate_random_chess_position is a start  
  > **username_4**: @username_0 Yeah, that should work although not very efficient. You should not generate total random FENs. Your FEN will be most likely result in a mate if either side has extra material.  
  > **username_4**: @username_0 If you think my answer is sufficient for you to get started, please put a tick and accept it!  
  > **username_0**: Yes, more specifically, I meant random within the limit of X number of pieces.  
  
  ---
  
  