From 797a64530ce2e1bd227cb24f46dfa659c16561f6 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 7 Oct 2014 18:56:59 +0200 Subject: [PATCH] Implement Betza hr and hr as chiral move sets To easily separate right- and left-handed moves on oblique atoms (which needs opposite use of l and r in their multi-leg continuations), the direction sets hr and hl are added. --- moves.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/moves.c b/moves.c index 647aa44..aed8d7c 100644 --- a/moves.c +++ b/moves.c @@ -300,6 +300,9 @@ MovesFromString (Board board, int flags, int f, int r, int tx, int ty, int angle break; case 'N': all = 0xFF; // oblique atom (degenerate 8-fold) if(tx >= 0) goto king; // continuation legs specified in K/Q system! + if(*desc == 'h') { // chiral direction sets 'hr' and 'hl' + dirSet = (desc[1] == 'r' ? 0x55 : 0xAA); desc += 2; + } else while(islower(*desc) && (i = dirType[*desc-'a']) != '0') { int b = dirs2[*desc-'a']; // when alone, use narrow version if(desc[1] == 'h') b = dirs1[*desc-'a'], desc += 2; // dirs1 is wide version -- 1.7.0.4