![]() |
|
|
#12 | |
|
"Robert Gerbicz"
Oct 2005
Hungary
148410 Posts |
Quote:
|
|
|
|
|
|
|
#13 |
|
Romulan Interpreter
Jun 2011
Thailand
7·1,373 Posts |
I have a more interesting puzzle here. Do you remember the "mate in 4 moves" with (white moves) e3, Qf3, Bc4, then Qf7# that we use to play when you were children?
I just created a piece of code that generates the next position (and shows it to me on board, for easier, manual play) therefore cycling easier through the 960 possible boards, without using the physical wooden stuff. This is very simple, and it took me less than 15 minutes to write it right now, during the lunch break. It is emulating exactly the "throwing dice" method, but having every time the right die with the right number of faces, therefore every board can be generated by exactly 4 casts (4x4x15x4, note that I place the horses before the queen). Cycling through each cast from 0 to n-1, in a nested for-loop, all boards can be generated and shown in sequence with a key press for each board. For example the position number 0 (all dice fall on 1) will generate the next row of woods: BBNNQRKR, and position number 1 (all dice felt 1, except for the last which felt 2) will put on the table BBNNRQKR (note that I place the horses before placing the queen, I have a reason for it, and this does not affect the puzzle in any way, and the king is placed last, between the rooks). Position 521 is RBQNBKNR etc. The "normal" chess position, RNBQKBNR is position number 390. There are 4 possibilities to place the first bishop, 4 to place the second, 15 to place the two knights on the remaining 5 squares (combinations of 6 taken by 2), and 4 to place the queen. Remaining squares are filled with RKR in order, as the king must be between rooks. This means generating 4 random numbers, three of them from 0 to 3, the forth from 0 to 14, place the pieces. Except that I do not generate random numbers, but start from (0,0,0,0) to (3,3,14,3) and generate all boards. Wait for a key to generate the next one. And 4x4x15x4=960. More than that, I will not do... (I mean programming). But looking to these positions for some minutes now, I found that almost all of them allow a fool mate in 4 moves. For example, the first position, BBNNQRKR, if white moves the pawn in front of the king, then black can mate him either with the queen, or bishop, usual way, or (a nicer way) opening the pawn in b7 and coming with the d8 knight in h3 (nice one huh? ) for which 3 moves are needed. Therefore my puzzle, which I consider a million times nicer than the original (sorry for my modesty hehe ) here:How many of the 960 positions do NOT allow a fool mate in 4 moves? This can be solved "analytically" (construct the position), but at least, if the candidate solver is not a good chess player, but a good programmer, he will still need to do some work, as the search space is bigger, and you can't stop earlier... Last fiddled with by LaurV on 2017-09-01 at 10:44 |
|
|
|
|
|
#14 | |
|
Romulan Interpreter
Jun 2011
Thailand
7×1,373 Posts |
Quote:
(otherwise, any position has a fool mate in just few moves, if the player "plays for the adversary", i.e. helping the other one to win). In which case, the white needs to move both pawns (otherwise the second pawn will temporarily block the mate, in most of the cases). That is why I said the problem is not interesting. But we are moving on the "spoiler" territory right now... Last fiddled with by LaurV on 2017-09-01 at 11:02 |
|
|
|
|
|
|
#15 | |
|
"Robert Gerbicz"
Oct 2005
Hungary
22×7×53 Posts |
Quote:
"Update (4/9): Update 4/9: Pay attention to the special Castling rules, see also at the Wikipedia link: https://en.wikipedia.org/wiki/Chess960 " |
|
|
|
|
|
|
#16 |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
23×3×5×72 Posts |
For castling to have any effect it must be either possible for the rook and king to switch places at the beginning of the game or it be possible to castle on the second move after a knight move.
|
|
|
|
|
|
#17 | ||
|
Romulan Interpreter
Jun 2011
Thailand
7·1,373 Posts |
Quote:
Quote:
Moreover, I still do not get it how the rules for castling can influence the fool mate. You play fool chess. This means white makes the worst possible moves (plays for the adversary). You can not castle at the first or the second move, unless this helps the adversary to mate you. You may only castle IF you put yourself in a mate position. You can not use the castling to evade/avoid the mate. Also, if you did not castle already, then you can not castle from a check position, or if you end up in a check position, therefore there is no influence here. Then, if white wastes a move with castling, it means he didn't move the second pawn, so the only possible mate is that black captures a pawn in row 2 (initial pawn position), or if a white pawn was moved to row 4, captures it with check (in this case, mate from the front). The first can't be done, because there are not enough moves for black to take out a long-range piece that can threat c2 or g2 and still be guarded (otherwise the white king captures it). For the second, say you have xxRKyyyy. One of y's must be a rock, and close to the king or in f1 must be either a queen or bishop, to block the mate from the h side (otherwise, if mate from the h side is possible, you don't care about the castling). Now, you can't put a rook in b1, because the rooks are both in the same side of the king, you can't put a queen or bishop, because they will block the mate (with or without castling) from c2 side or from front, so you must put a knight. Now, you can not mate from the left because the rook will block c2, and you can not mate from the right. If you castle, you can not mate from the right because the rook blocks d2, you can not mate from the left because the horse beats a3. If horse moved out, in either a3 or c2, its square in b1 is free and the king can move there, so no mate. This position has no fool mate, unless one is available without castling (if the yyyy are arranged conveniently, a mate may be possible from the right). Same reasoning for the other side, when yyyyyKRx. I didn't put the pieces down, so I may be wrong, this is only a "mental exercise". But "i feel" that the castling rules will not influence the outcome of the game, this is my first impression. Well... argh... you used to prove me wrong in the past, so I will not be surprised if...
|
||
|
|
|
|
|
#18 | |
|
Just call me Henry
"David"
Sep 2007
Cambridge (GMT/BST)
23·3·5·72 Posts |
Quote:
Last fiddled with by henryzz on 2017-09-05 at 11:23 Reason: Muddled colours |
|
|
|
|
|
|
#19 | |
|
"Robert Gerbicz"
Oct 2005
Hungary
5CC16 Posts |
Quote:
Tricky/harder problem, not the coding, but the testing. Last fiddled with by R. Gerbicz on 2017-09-19 at 19:48 |
|
|
|
|
|
|
#20 |
|
"Mike"
Aug 2002
25·257 Posts |
|
|
|
|
|
|
#21 |
|
Romulan Interpreter
Jun 2011
Thailand
7·1,373 Posts |
Just to set the tings right...
We did not revisit this thread (no time!) but now, because we went to the site to check the solution for Feb 2018, we remembered about this problem and went there to check for solutions. And we discovered that it is possible to mate after the castling Well...
|
|
|
|
|
|
#22 |
|
Feb 2018
2 Posts |
Here's a lazy way to solve it with the python-chess package.
|
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| September 2016 | Batalov | Puzzles | 8 | 2016-10-04 14:10 |
| September 2015 | Xyzzy | Puzzles | 12 | 2015-10-07 14:43 |
| September 2014 | Xyzzy | Puzzles | 3 | 2014-11-02 19:04 |
| TPS Record Rally: September 16-21 | Oddball | Twin Prime Search | 11 | 2011-09-22 06:47 |
| Anyone going to Vienna in September? | fivemack | Factoring | 1 | 2007-09-07 00:29 |