; *** Endodoi 
; *** (c) 2001 W. D. Troyka
; *** dtroyka@justice.com


;	ENDODOI COMMON MACROS


;	ADD BEAN(S) TO HOLE WHILE SOWING

; 	add bean to hole while sowing first lap

(define AB if (piece? $1) (change-type $2) else)

(define OC (set-position-flag occ true))

(define ABC
	((AB $1 $2)   ((AB $3 $4)   ((AB $5 $6)   ((AB $7 $8)
	((AB $9 $10)  ((AB $11 $12) ((AB $13 $14) ((AB $15 $16)
	((AB $17 $18) ((AB $19 $20) ((AB $21 $22) ((AB $23 $24)
	((AB $25 $26) ((AB $27 $28) ((AB $29 $30) ((AB $31 $32)
	((AB $33 $34) ((AB $35 $36) ((AB $37 $38) ((AB $39 $40) 
	((AB $41 $42) ((AB $43 $44) ((AB $45 $46) ((AB $47 $48)
	((AB $49 $50) ((AB $51 $52) ((AB $53 $54) ((AB $55 $56)
	((AB $57 $58) ((AB $59 $60) ((AB $61 $62) ((AB $63 $64)
	((AB $65 $66) ((AB $67 $68) ((AB $69 $70) ((AB $71 $72)
	(set-flag emu true)))))))))))))))))))))))))))))))))))))
)

(define add-bean
	(ABC 	 0B  1B  1B  2B  2B  3B  3B  4B  4B  5B  5B  6B  
		 6B  7B  7B  8B  8B  9B  9B 10B 10B 11B 11B 12B 
		12B 13B 13B 14B 14B 15B 15B 16B 16B 17B 17B 18B 
		18B 19B 19B 20B 20B 21B 21B 22B 22B 23B 23B 24B
		24B 25B 25B 26B 26B 27B 27B 28B 28B 29B 29B 30B
		30B 31B 31B 32B 32B 33B 33B 34B 34B 35B 35B 36B)
)

; 	add two beans to hole while sowing second lap

(define add-bean2 
	(ABC 	 0B  2B  1B  3B  2B  4B  3B  5B  4B  6B  5B  7B  
		 6B  8B  7B  9B  8B 10B  9B 11B 10B 12B 11B 13B 
		12B 14B 13B 15B 14B 16B 15B 17B 16B 18B 17B 19B 
		18B 20B 19B 21B 20B 22B 21B 23B 22B 24B 23B 24B
		24B 26B 25B 27B 26B 28B 27B 29B 28B 30B 29B 31B
		30B 32B 31B 33B 32B 34B 33B 35B 34B 36B 35B 36B)
)

; 	add three beans to hole when sowing three laps

(define add-bean3 
	(ABC 	 0B  3B  1B  4B  2B  5B  3B  6B  4B  7B  5B  8B  
		 6B  9B  7B 10B  8B 11B  9B 12B 10B 13B 11B 14B 
		12B 15B 13B 16B 14B 17B 15B 18B 16B 19B 17B 20B 
		18B 21B 19B 22B 20B 23B 21B 24B 22B 24B 23B 24B
		24B 27B 25B 28B 26B 29B 27B 30B 28B 31B 29B 32B
		30B 33B 31B 34B 32B 35B 33B 36B 34B 36B 35B 36B)
)

; 	add four beans to hole when sowing four laps

(define add-bean4 
	(ABC 	 0B  4B  1B  5B  2B  6B  3B  7B  4B  8B  5B  9B  
		 6B 10B  7B 11B  8B 12B  9B 13B 10B 14B 11B 15B 
		12B 16B 13B 17B 14B 18B 15B 19B 16B 20B 17B 21B 
		18B 22B 19B 23B 20B 24B 21B 25B 22B 26B 23B 27B
		24B 28B 25B 29B 26B 30B 27B 31B 28B 32B 29B 33B
		30B 34B 31B 35B 32B 36B 33B 36B 34B 36B 35B 36B)
)


;	CAPTURE BEANS

;	capture extra bean when sown piece is captured

(define EB (set-flag extra-bean true))

(define EX 
	(if friend?
	(if (or (piece? 7B) (piece? 8B)  (piece? 9B) 
		(piece? 10B) (piece? 11B) (piece? 12B)) (EB))
	else (if (or
	(and (or (position? E) (position? e)) (piece? 2B))
	(and (or (position? D) (position? d)) (or (piece? 3B) (piece? 4B)))
	(and (or (position? C) (position? c)) (or (piece? 4B) (piece? 5B)
		(piece? 6B)))
	(and (or (position? B) (position? b)) (or (piece? 5B) (piece? 6B)
		(piece? 7B) (piece? 8B)))
	(and (or (position? A) (position? a)) (or (piece? 6B) (piece? 7B) 
		(piece? 8B) (piece? 9B) (piece? 10B))))
	(EB)))
)

; 	capture beans in opponent's hole and place in store

(define next $1 (while not-empty? e) (while (position-flag? occ) e))

(define ST 
	(if (flag? extra-bean) e) 
	(if (flag? sweep) (opposite e))
	(set-position-flag stop true)
)

(define e5 e e e e e) (define e10 (e5) (e5)) (define e20 (e10) (e10))
	 
(define set-stop
	(if (piece? 0B) (next) (ST) else
	 (if (piece? 1B) (next) e (ST) else
	  (if (piece? 2B) (next) e e (ST) else
	   (if (piece? 3B) (next) e e e (ST) else
	    (if (piece? 4B) (next) e e e e (ST) else 
	     (if (piece? 5B) (next) (e5) (ST) else
	      (if (piece? 6B) (next) (e5) e (ST) else
	       (if (piece? 7B) (next) (e5) e e (ST) else
	        (if (piece? 8B) (next) (e5) e e e (ST) else
	         (if (piece? 9B) (next) (e5) e e e e (ST) else
	          (if (piece? 10B) (next) (e10) (ST) else
		   (if (piece? 11B) (next) (e10) e (ST) else
		    (if (piece? 12B) (next) (e10) e e (ST) else
	(if (piece? 13B) (next) (e10) e e e (ST) else
	 (if (piece? 14B) (next) (e10) e e e e (ST) else
	  (if (piece? 15B) (next) (e10) (e5) (ST) else
	   (if (piece? 16B) (next) (e10) (e5) e (ST) else 
	    (if (piece? 17B) (next) (e10) (e5) e e (ST) else
	     (if (piece? 18B) (next) (e10) (e5) e e e (ST) else
	      (if (piece? 19B) (next) (e10) (e5) e e e e (ST) else
	       (if (piece? 20B) (next) (e20) (ST) else
	        (if (piece? 21B) (next) (e20) e (ST) else
	         (if (piece? 22B) (next) (e20) e e (ST) else
		  (if (piece? 23B) (next) (e20) e e e (ST) else
		   (if (piece? 24B) (next) (e20) e e e e (ST) else
        (if (piece? 25B) (next) (e20) (e5) (ST) else
	 (if (piece? 26B) (next) (e20) (e5) e (ST) else
	  (if (piece? 27B) (next) (e20) (e5) e e (ST) else
	   (if (piece? 28B) (next) (e20) (e5) e e e (ST) else 
	    (if (piece? 29B) (next) (e20) (e5) e e e e (ST) else
	     (if (piece? 30B) (next) (e20) (e10) (ST) else
	      (if (piece? 31B) (next) (e20) (e10) e (ST) else
	       (if (piece? 32B) (next) (e20) (e10) e e (ST) else
	        (if (piece? 33B) (next) (e20) (e10) e e e (ST) else
	         (if (piece? 34B) (next) (e20) (e10) e e e e (ST) else
		  (if (piece? 35B) (next) (e20) (e10) (e5) (ST) else
		   (if (piece? 36B) (next) (e20) (e10) (e5) e (ST)
	)))))))))))))))))))))))))))))))))))))
)

(define take-beans			
	mark (set-stop) back (next) cascade
	(while (not-position-flag? stop) to (OC) e cascade)
	(OC) (set-position-flag stop false) to back 
)

(define X	
	(if (and friend? (or (piece? 0B) (position-flag? lift-hole))) 
	(if (or (and (piece? 0B ns) (not-flag? extra-bean))
		(position-flag? lift-hole ns)) (Y enemy?) 
		(CM true) add (verify false))
 	(change-type 0B) ns 
	(change-type 0B)
	(take-beans x)) 
	add (verify false)
)


;	RED STRIP MANAGEMENT

;	turn off red-strip after fourth move

(define SA	
	(if (not 1-move) (set-attribute 1-move true) else
	 (if 19-move back (change-type 0B t) else
	  (if 18-move (set-attribute 19-move true) else
	   (if 17-move (set-attribute 18-move true) else
	    (if 16-move (set-attribute 17-move true) else
	     (if 15-move (set-attribute 16-move true) else
	      (if 14-move (set-attribute 15-move true) else
	       (if 13-move (set-attribute 14-move true) else
	        (if 12-move (set-attribute 13-move true) else
	         (if 11-move (set-attribute 12-move true) else
	          (if 10-move (set-attribute 11-move true) else
	           (if 9-move (set-attribute 10-move true) else
	            (if 8-move (set-attribute 9-move true) else
	             (if 7-move (set-attribute 8-move true) else
	              (if 6-move (set-attribute 7-move true) else
	               (if 5-move (set-attribute 6-move true) else
	                (if 4-move (set-attribute 5-move true) else
	                 (if 3-move (set-attribute 4-move true) else
	                  (if 2-move (set-attribute 3-move true) else
	  		   (if 1-move (set-attribute 2-move true)                    
	))))))))))))))))))))
)

;	reset red-strip attributes

(define RA				
	(set-attribute 1-move false)
	(set-attribute 2-move false)
	(set-attribute 3-move false)
	(set-attribute 4-move false)
	(set-attribute 5-move false)
	(set-attribute 6-move false)
	(set-attribute 7-move false)
	(set-attribute 8-move false)
	(set-attribute 9-move false)
	(set-attribute 10-move false)
	(set-attribute 11-move false)
	(set-attribute 12-move false)
	(set-attribute 13-move false)
	(set-attribute 14-move false)
	(set-attribute 15-move false)
	(set-attribute 16-move false)
	(set-attribute 17-move false)
	(set-attribute 18-move false)
	(set-attribute 19-move false)
)

;	allow extra move after landing in occupied hole

(define Y (if ($1 y1) y1 else y2))

(define CM (set-attribute can-move $1))

(define MX 
	mark (if (and (not-piece? 0B) (not-position-flag? lift-hole))
	t (change-type RS) back (Y friend?) (CM false) (SA) back 
	    (Y enemy?) (CM true) add (verify false) 
	    else (Y friend?) (CM false)
		 (Y enemy?) (CM true) (RA) back)
)


;	DETERMINE LEGAL MOVES

;	test to see which variant is being played

(define game-over?
	y1 
	(if 3-bean (verify (and (empty? $1) (empty? $2))) else
	(if 4-bean (verify (and (empty? $3) (empty? $4))) else
	(if 5-bean (verify (and (empty? $5) (empty? $6))) else
	(if 6-bean (verify (and (empty? $7) (empty? $8)))))))
	back
)

; 	limit move to friendly hole with pieces in it

(define preconditions
	(verify (and (not-piece? 0B) 
		(or (and friend? (can-move u)) (piece? RS t)))) 
)

;	preliminary operations

(define Q 
	(game-over? $1 $2 $3 $4 $5 $6 $7 $8) 
	(freeze) (change-type $9) to 
	(set-flag sweep false)
	(set-flag second-lap false)
	(set-flag extra-bean false)
	(set-position-flag lift-hole true)
	mark t (change-type 0B) back
	(if (enemy? t) flip)
	(Y enemy?) (RA) back
)

(define QE (if enemy? (change-type 1B)))

;	prevent normal move if all opponent holes are empty

(define freeze
	mark
	(while friend? cw)
	(while (and (piece? 0B) enemy?) cw)
	(if friend? (verify false))
	back
)

;	if all opponent holes are empty, capture remaining beans

(define clean-up 
	((verify (and friend? (not-piece? 0B))) 
	(game-over? $1 $2 $3 $4 $5 $6 $7 $8) to  
	(while friend? cw)
	(while (and (piece? 0B) enemy?) cw)  
	(if friend? (set-flag sweep true)
	(while friend? (if (not-piece? 0B) 
	(change-type 0B) (take-beans y)) cw) 
	add)
))


;	SOW BEANS

; 	determine drop hole

(define DH (set-position-flag drop-hole true) back else)

(define drop-hole?
	(if (piece? $1)  cc (DH) 
	(if (piece? $2)  cc cc (DH) 
	(if (piece? $3)  cc cc cc (DH) 
	(if (piece? $4)  cc cc cc cc (DH) 
	(if (piece? $5)  cc cc cc cc cc (DH) 
	(if (piece? $6)  cc cc cc cc cc cc (DH) 
	(if (piece? $7)  cw cw cw cw cw (DH) 
	(if (piece? $8)  cw cw cw cw (DH) 
	(if (piece? $9)  cw cw cw (DH) 
	(if (piece? $10) cw cw (DH) 
	(if (piece? $11) cw (DH) 
	(verify false))))))))))))
)

(define drop-hole4?
	(if (piece? $1)  cc (DH) 
	(if (piece? $2)  cc cc (DH) 
	(if (piece? $3)  cc cc cc (DH) 
	(if (piece? $4)  cc cc cc cc (DH) 
	(if (piece? $5)  cw cw cw (DH) 
	(if (piece? $6)  cw cw (DH) 
	(if (piece? $7)  cw (DH) 
	(verify false))))))))
)

(define drop-hole5?
	(if (piece? $1)  cc (DH) 
	(if (piece? $2)  cc cc (DH) 
	(if (piece? $3)  cc cc cc (DH) 
	(if (piece? $4)  cc cc cc cc (DH) 
	(if (piece? $5)  cc cc cc cc cc (DH) 
	(if (piece? $6)  cw cw cw cw (DH) 
	(if (piece? $7)  cw cw cw (DH) 
	(if (piece? $8)  cw cw (DH) 
	(if (piece? $9)  cw (DH) 
	(verify false))))))))))
)

; 	macros for counting holes

(define L1				; sow partial first lap
	(while (not-position-flag? drop-hole) 
	cc (add-bean))) 

(define FL1 cc				; finish first lap
	(while (not-position-flag? lift-hole) 
	(add-bean) cc)) 

(define L2 				; sow partial second lap
	(while (not-position-flag? drop-hole) 
	cc (add-bean2))) 

(define FL2 cc	 			; finish second lap
	(while (not-position-flag? lift-hole) 
	(add-bean2) cc))

(define L3 				; sow partial third lap
	(while (not-position-flag? drop-hole) 
	cc (add-bean3))) 

(define FL3 cc	 			; finish third lap
	(while (not-position-flag? lift-hole) 
	(add-bean3) cc))

(define L4 				; sow partial fourth lap
	(while (not-position-flag? drop-hole) 
	cc (add-bean3))) 


;	PIECE DEFINITIONS

(define common-piece
	(name $1)
	(notation "$2")
	(help "$2")
      	(description "$2:  Beans in a hole are sown one at a time in
		successive holes counterclockwise around the board.  If 
		a sowing ends in an occupied hole on either side of the
		board, the beans in that hole, including the bean just 
		dropped, are picked up and a new sowing begins as part 
		of the same turn.  You can make up to 20 moves in a turn 
		this way.  Beans are not dropped into the store but are 
		sown into the lift hole on subsequent laps.  If the last 
		bean is dropped in an empty hole on the player's side of 
		the board, any beans in the opponent's opposing hole 
		are captured.  If the last bean is dropped in an enemy 
		hole or in a friendly hole opposite an empty enemy hole, 
		the turn ends without any captures.")
)

(define Piece
	(common-piece)
	(image 	Bottom "Mancala\$2.bmp"
		Top "Mancala\$2.bmp")
)

(define red-attributes
	(dummy)
 	(attribute can-move true)
	(attribute 1-move false)
        (attribute 2-move false) 
	(attribute 3-move false)
	(attribute 4-move false) 
	(attribute 5-move false) 
	(attribute 6-move false) 
	(attribute 7-move false) 
	(attribute 8-move false) 
	(attribute 9-move false) 
	(attribute 10-move false) 
	(attribute 11-move false)
        (attribute 12-move false) 
	(attribute 13-move false)
	(attribute 14-move false) 
	(attribute 15-move false) 
	(attribute 16-move false)
        (attribute 17-move false) 
	(attribute 18-move false)
	(attribute 19-move false) 
	(attribute $1 true)
	(attribute $2 false) 
	(attribute $3 false)
	(attribute $4 false)
)

(define Red-Strip (piece (Piece RS red-strip) (red-attributes)))


;	GAME BLOCK

(define common
   (description "Endodoi is a well-known multi-lap Mancala game played by 
	the Masai in Kenya and Tanzania.  Multi-lap games are distinguished 
	by the rule that when a sowing ends in an occupied hole on either 
	side of the board, the beans in that hole are picked up and a new 
	sowing beginsas part of the same turn.  This process continues until 
	the sowing ends in an empty hole.  You can make up to twenty moves 
	in a turn this way in this implementation. 
	\\
	Capturing in Endodoi is the same as in Kalah.  When the sowing ends 
	in an empty hole on the player's side of the board, any enemy beans 
	in the hole directly opposite are captured and placed in the store.  
	Sowing in Endodoi is counterclockwise.  Beans are sowed into the 
	lift hole on subsequent laps.  Beans are not sowed into the store.
	\\
	The complete rules of Endodoi are as follows:
	\\
	The board is divided into twelve holes and two stores.  One player 
	plays from the bottom six holes and the other plays from the top 
	six.   The stores are used for storing captured pieces -- called 
	beans -- and do not play a role in the game.  The right store is 
	for the bottom player and the left store for the top player.
	\\
	The game begins with four beans in each of the twelve holes.  The 
	bottom player goes first.  A move is made by picking up the beans 
	in a player's hole and sowing them one at a time counterclockwise 
	around the board. Sowing begins with the hole immediately after 
	the lift hole and continues until all the beans have been dropped.  
	Beans are dropped into the lift hole on subsequent laps (unlike in
	Wari) but not into the store.
	\\
	If the sowing ends in an occupied hole on either side of the board,
	the beans in that hole are picked up, including the last bean 
	dropped, and sowed again as part of the same turn.  This process 
	is continued until the sowing ends in an empty hole.  You can make 
	up to twenty moves in a turn this way in this implementation. 
	\\
	If the last bean is dropped in a friendly hole, any beans in the 
	opposing enemy hole are captured -- along with the last bean dropped 
	-- and the turn ends.  If the last bean is dropped in an enemy hole 
	or in a friendly hole opposite an empty enemy hole, the turn ends
	without any captures. 
	\\
	The game ends when a player captures over half of the beans (25 in
	the 4-bean variant) or when all of one player's holes are empty.  
	In the latter case, all remaining beans are awarded to the opponent.  
	If it is your turn to move and all opponent holes are empty, click 
	on any occupied hole to capture the remaining beans.  The winner 
	is the player with the most captured beans at the end of the game. 
	\\
	If the players each capture half the beans, a draw is declared.
	The holes hold up to thirty-six beans.  Any additional beans 
	added to a hole are skimmed off the top and removed from play.
	In the variants, the players start with three through six beans 
	in each hole on boards with dimensions 2x4, 2x5, 2x6, 2x7, and 2x8.  
	A player wins by capturing more than half of all available beans.
	\\
	Please send any comments or bug reports to dtroyka@justice.com.  
	For other Mancala games available on Zillions, check out Congklak, 
	Cross-Wari, and Cross-Kalah.")
   (history "Mancala v.2.0  (c) 2001  W. D. Troyka")
   (strategy "Unlike most single-lap Mancala games, the multi-lap nature of
	Endodoi permits captures to be made on the first move.  Play around
	with Bottom's six opening choices in each variant to see which moves
	result in captures.  Capturing on the opening move is not necessarily
	advantageous.  In the principal game (four beans per hole), if Bottom
	opens by sowing from B, C, or D, seven beans will be captured.  Each 
	of these openings, however, permits the Top player to capture even 
	more beans on the next turn!
	\\
	Successful play in Endodoi requires an ability to look ahead and 
	see where a sowing ultimately will end, all the while remaining
	cognizant of how each sowing changes the board.  Generally speaking
	you should leave some empty holes on your side of the board to 
	create capturing opportunities.  
	\\
	Also important is setting up sowings that return to a lift hole on 
	the player's side.  A lift hole is always empty after a single lap 
	and the opposite hole is usually occupied because a bean has just 
	been sown into it.  If the lift hole has four beans in it and the 
	initial drop hole has eight beans (counting the one just dropped 
	in it), then the seven beans will sow back into the lift hole, 
	resulting in capture of at least two beans.  Twelve beans in a 
	lift hole on the moving player's side will result in automatic 
	capture with a single sowing.")  
   (animate-drops false)
   (animate-captures false)
   (players Bottom Top)
   (turn-order Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom 
	Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom Bottom 
	Bottom Bottom Bottom Top Top Top Top Top Top Top Top Top Top 
	Top Top Top Top Top Top Top Top Top Top)
   (pass-turn forced)
   (count-condition (Bottom Top) stalemated)
)

(define image-audio
   (music "..\Audio\Mancala\Nyayito.mid")		; song from Ghana
   (opening-sound "..\Audio\Mancala\drop.wav")
   (drop-sound "..\Audio\Mancala\sow.wav")
   (change-sound "..\Audio\Mancala\sow.wav")
   (win-sound "..\Audio\Mancala\elephant.wav")
   (loss-sound "..\Audio\Mancala\elephant.wav")
   (capture-sound "")
   (piece (Piece 36B 36-beans))
   (piece (Piece 35B 35-beans))
   (piece (Piece 34B 34-beans))
   (piece (Piece 33B 33-beans))
   (piece (Piece 32B 32-beans))
   (piece (Piece 31B 31-beans))
   (piece (Piece 30B 30-beans))
   (piece (Piece 29B 29-beans))
   (piece (Piece 28B 28-beans))
   (piece (Piece 27B 27-beans))
   (piece (Piece 26B 26-beans))
   (piece (Piece 25B 25-beans))
   (piece (Piece 24B 24-beans))
   (piece (Piece 23B 23-beans))
   (piece (Piece 22B 22-beans))
   (piece (Piece 21B 21-beans))
   (piece (Piece 20B 20-beans))
   (piece (Piece 19B 19-beans))
   (piece (Piece 18B 18-beans))
   (piece (Piece 17B 17-beans))
   (piece (Piece 16B 16-beans))
   (piece (Piece 15B 15-beans))
   (piece (Piece 14B 14-beans))
   (piece (Piece 13B 13-beans))
   (piece (Piece 12B 12-beans))
   (piece (Piece 11B 11-beans))
   (piece (Piece 10B 10-beans))
   (piece (Piece 9B 9-beans))
   (piece (Piece 8B 8-beans))
   (piece (Piece 7B 7-beans))
   (piece (Piece 6B 6-beans))
   (piece (Piece 5B 5-beans))
   (piece (Piece 4B 4-beans))
   (piece (Piece 3B 3-beans))
   (piece (Piece 2B 2-beans))	
   (piece (Piece 1B 1-bean))
   (piece (Piece 0B 0-beans)) 		
)


;	SELECT SCREEN

(define select-board
    (board 
      	(image "Mancala\select.bmp")
  	(grid
     		(start-rectangle 20 20 170 55)
		(dimensions 
			("A/B/C" (192 0))  ; files
     		 	("6/5/4/3/2/1/0" (0 38))) ; ranks
)))

(define Select
	(name $1)
	(notation "$2")
	(help "Click here to select the $2 variants")
      	(description "$2:  Click here to select the $2 variants")
	(image 	Background "Mancala\$3.bmp")
	(open "$2.zrf")
)

(define Mancala-Select
   (title "Mancala Select")
   (description "Select the Mancala variant you want to play.")
   (history "Mancala v. 2.0  (c) 2001  W. D. Troyka")
   (strategy "")
   (music "..\Audio\Mancala\jeopardy.mid")
   (change-sound "..\Audio\Mancala\midiprompt.wav")
   (players Background Top Bottom)
   (turn-order Background)
   (select-board)
   (board-setup 
	(Background  
		(Wari A6) 	(Kalah B6) 	(Endodoi C6)
		(W4 A5)		(K4 B5)		(E4 C5)
		(W5 A4)		(K5 B4)		(E5 C4)
		(W6 A3)		(K6 B3)		(E6 C3)
		(W7 A2)		(K7 B2)		(E7 C2)
		(W8 A1)		(K8 B1)		(E8 C1)
		(Music A0)	(Music B0)	(Music C0)))
   (piece (Select Wari Wari2x6 header-W))
   (piece (Select W4 Wari2x4 S4))
   (piece (Select W5 Wari2x5 S5))
   (piece (Select W6 Wari2x6 S6))
   (piece (Select W7 Wari2x7 S7))
   (piece (Select W8 Wari2x8 S8))
   (piece (Select Kalah Kalah2x6 header-K))
   (piece (Select K4 Kalah2x4 S4))
   (piece (Select K5 Kalah2x5 S5))
   (piece (Select K6 Kalah2x6 S6))
   (piece (Select K7 Kalah2x7 S7))
   (piece (Select K8 Kalah2x8 S8))
   (piece (Select Endodoi Endodoi2x6 header-E))
   (piece (Select E4 Endodoi2x4 S4))
   (piece (Select E5 Endodoi2x5 S5))
   (piece (Select E6 Endodoi2x6 S6))
   (piece (Select E7 Endodoi2x7 S7))
   (piece (Select E8 Endodoi2x8 S8))
   (piece (name Music) (dummy) (moves (flip flip flip add)))
   (piece (name bean) (dummy))
)
