Moderator: Pachnes
// Namespace Declaration
using System;
// Program start class
class InteractiveWelcome
{
// Main begins program execution.
public static void Main()
{
int YKRANK, YKFILE, TKRANK, TKFILE, MOVER;
Console.WriteLine("What rank is your king on?:");
YKRANK = int.Parse(Console.ReadLine());
Console.WriteLine("What file is your king on? (a=1, b=2, c=3, d=4, etc.):");
YKFILE = int.Parse(Console.ReadLine());
Console.WriteLine("What rank is their king on?:");
TKRANK = int.Parse(Console.ReadLine());
Console.WriteLine("What file is their king on? (a=1, b=2, c=3, d=4, etc.):");
TKFILE = int.Parse(Console.ReadLine());
Console.WriteLine("Is it your turn to move? Type 1 for yes, or 0 for no.");
MOVER = int.Parse(Console.ReadLine());
if ((Math.Abs(YKRANK - TKRANK)) < 2 && (Math.Abs(YKFILE - TKFILE)) < 2)
Console.WriteLine("That is an illegal position!");
else
{
if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE - TKFILE) % 2 == 0 && MOVER == 0)
Console.WriteLine("You have opposition!");
if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE - TKFILE) % 2 == 0 && MOVER == 0 && YKRANK != TKRANK && YKFILE != TKFILE)
Console.WriteLine("You can achieve a more linear form of opposition after at least " + ((Math.Abs(YKRANK - TKRANK) - 1) + (Math.Abs(YKFILE - TKFILE) - 1)) + " half-moves!");
if ((YKRANK - TKRANK) % 2 == 0 && YKFILE == TKFILE && MOVER == 0)
Console.WriteLine("You have vertical opposition!");
if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE == TKFILE) && MOVER == 0)
Console.WriteLine("Use it for defense to stop enemy from reaching/passing the " + ((YKRANK + TKRANK) / 2) + "th rank!");
if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE == TKFILE) && MOVER == 0)
Console.WriteLine("Or use it for offense to forcibly reach/pass the " + ((YKRANK + TKRANK) / 2) + "th rank!");
if (YKRANK == TKRANK && (YKFILE - TKFILE) % 2 == 0 && MOVER == 0)
Console.WriteLine("You have horizontal opposition!");
if (YKRANK == TKRANK && (YKFILE - TKFILE) % 2 == 0 && MOVER == 0)
Console.WriteLine("Use it for defense to stop enemy from reaching/passing the " + ((YKFILE + TKFILE) / 2) + "th file...");
if (YKRANK == TKRANK && (YKFILE - TKFILE) % 2 == 0 && MOVER == 0)
Console.WriteLine("Or use it for offense to forcibly reach/pass the " + ((YKFILE + TKFILE) / 2) + "th file...");
if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE - TKFILE) % 2 == 0 && MOVER == 1)
Console.WriteLine("Your opponent has opposition!");
if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE - TKFILE) % 2 == 0 && MOVER == 1 && YKRANK != TKRANK && YKFILE != TKFILE)
Console.WriteLine("They can achieve a more linear form of opposition after at least " + ((Math.Abs(YKRANK - TKRANK) - 1) + (Math.Abs(YKFILE - TKFILE) - 1)) + " half-moves!");
if ((YKRANK - TKRANK) % 2 == 0 && YKFILE == TKFILE && MOVER == 1)
Console.WriteLine("Your opponent has vertical opposition!");
if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE == TKFILE) && MOVER == 1)
Console.WriteLine("They can use it for defense to stop you from reaching/passing the " + ((YKRANK + TKRANK) / 2) + "th rank!");
if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE == TKFILE) && MOVER == 1)
Console.WriteLine("Or use it for offense to forcibly reach/pass the " + ((YKRANK + TKRANK) / 2) + "th rank!");
if (YKRANK == TKRANK && (YKFILE - TKFILE) % 2 == 0 && MOVER == 1)
Console.WriteLine("Your opponent has horizontal opposition!");
if (YKRANK == TKRANK && (YKFILE - TKFILE) % 2 == 0 && MOVER == 1)
Console.WriteLine("They can use it for defense to stop you from reaching/passing the " + ((YKFILE + TKFILE) / 2) + "th file...");
if (YKRANK == TKRANK && (YKFILE - TKFILE) % 2 == 0 && MOVER == 1)
Console.WriteLine("Or use it for offense to forcibly reach/pass the " + ((YKFILE + TKFILE) / 2) + "th file...");
else if ((YKRANK - TKRANK) % 2 != 0 && (YKFILE - TKFILE) % 2 != 0 && MOVER == 0)
Console.WriteLine("Your opponent can maintain opposition by moving to one of these four places: (" + ((TKFILE + 1)) + "th file),(" + ((TKRANK + 1)) + "th rank), or (" + ((TKFILE + 1)) + "th file),(" + ((TKRANK - 1)) + "th rank), or (" + ((TKFILE - 1)) + "th file),(" + ((TKRANK + 1)) + "th rank), or (" + ((TKFILE - 1)) + "th file),(" + ((TKRANK - 1)) + "th rank) ");
else if ((YKRANK - TKRANK) % 2 != 0 && (YKFILE - TKFILE) % 2 != 0 && MOVER == 1)
Console.WriteLine("You can maintain opposition by moving to one of these four places: (" + ((YKFILE + 1)) + "th file),(" + ((YKRANK + 1)) + "th rank), or (" + ((YKFILE + 1)) + "th file),(" + ((YKRANK - 1)) + "th rank), or (" + ((YKFILE - 1)) + "th file),(" + ((YKRANK + 1)) + "th rank), or (" + ((YKFILE - 1)) + "th file),(" + ((YKRANK - 1)) + "th rank) ");
else if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE - TKFILE) % 2 != 0 && MOVER == 1)
Console.WriteLine("You can maintain opposition by moving to either of these two places: (" + ((YKFILE + 1)) + "th file),(" + ((YKRANK + 0)) + "th rank), or (" + ((YKFILE - 1)) + "th file),(" + ((YKRANK + 0)) + "th rank) ");
else if ((YKRANK - TKRANK) % 2 == 0 && (YKFILE - TKFILE) % 2 != 0 && MOVER == 0)
Console.WriteLine("Your opponent can maintain opposition by moving to either of these two places: (" + ((TKFILE + 1)) + "th file),(" + ((TKRANK + 0)) + "th rank), or (" + ((TKFILE - 1)) + "th file),(" + ((TKRANK + 0)) + "th rank) ");
else if ((YKRANK - TKRANK) % 2 != 0 && (YKFILE - TKFILE) % 2 == 0 && MOVER == 1)
Console.WriteLine("You can maintain opposition by moving to either of these two places: (" + ((YKFILE + 0)) + "th file),(" + ((YKRANK + 1)) + "th rank), or (" + ((YKFILE + 0)) + "th file),(" + ((YKRANK - 1)) + "th rank) ");
else if ((YKRANK - TKRANK) % 2 != 0 && (YKFILE - TKFILE) % 2 == 0 && MOVER == 0)
Console.WriteLine("Your opponent can maintain opposition by moving to either of these two places: (" + ((TKFILE + 0)) + "th file),(" + ((TKRANK + 1)) + "th rank), or (" + ((TKFILE + 0)) + "th file),(" + ((TKRANK - 1)) + "th rank) ");
}
// prevent screen from vanishing
// when run from VS.NET
Console.ReadLine();
}
}



h.g.muller wrote:The generator posted on my website (as C code)
[Event "Computer Chess Game"]
[Site "CHESS_LAPTOP"]
[Date "2011.11.09"]
[Round "-"]
[White "EGTgen 1.0.4"]
[Black "hgm"]
[Result "1-0"]
[TimeControl "40/60"]
[Variant "fairy"]
[FEN "8/8/8/8/4k3/8/4K3/3WW3 w - - 0 1"]
[SetUp "1"]
{--------------
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . k . . .
. . . . . . . .
. . . . K . . .
. . . W W . . .
white to play
--------------}
1. Wd1c2 Kd4 2. Wc2d3+ Kc4 3. Wd3e4 Kd5 4. Ke3 Kc4 5. We1f2 Kc3 6. Wf2g3
Kc4 7. Wg3f4 Kd5 8. Wf4e5+ Kd6 9. We4d5+ Ke7 10. Wd5e6+ Kf7 11. We5d6 Ke8
12. We6d7 Kf7 13. Kf4 Kf6 14. Wd7e6+ Kg6 15. Kg4 Kf7 16. Wd6e7+ Kg7 17.
We6f7+ Kg6 18. We7f6+ Kh6 19. Wf7g8 Kh7 20. Wf6g7+ Kh6 21. Wg8h7# {checkmate} 1-0
byakuugan wrote:Eventually I want to get around to studying these concepts for every piece type, like if Knights moved as Camels when not capturing, they would lose a lot of their straightforward cornering abilities, but would be able to maintain control of the same square when moving.
Right now I was working on comparing the strengths of normal leapers, when stalemate is not an issue.
It seems that Knight+Knight, Knight+Zebra, Camel+Camel, Camel+Zebra, and Zebra+Zebra (all have 8 move targets and none are mating material against a lone king) generally win against a Flamingo, but not if a piece is only a 4-mover (like Knight+Ferz or Zebra+Wazir won't win). But if instead of a Flamingo, if the defender has an Alfil, then Knight+Knight are the only non-matingmaterial leapers that can win.
It seems that the knight and wazir are the only leapers with the ability to make the 3-move tour from c1 to b1,
Users browsing this forum: Google [Bot] and 0 guests