50 moves without checkmate draw condi... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » 50 moves without checkmate draw condition « Previous Next »

Author Message
Mariano Moran Fougerat (Marianomf)
New member
Username: Marianomf

Post Number: 49
Registered: 10-2013
Posted on Saturday, November 09, 2013 - 9:25 pm:   

i want to know if theres possible to puta a 50 moves without checkmate draw condition
Sean Duggan (Dream)
New member
Username: Dream

Post Number: 99
Registered: 9-2000
Posted on Saturday, November 09, 2013 - 10:10 pm:   

I don't believe so.
Greg Schmidt (Gschmidt2)
New member
Username: Gschmidt2

Post Number: 174
Registered: 1-2007
Posted on Sunday, November 10, 2013 - 12:56 am:   

I think there may be a roundabout way to do it. Create 50 dummy positions (e.g. p1, p2, ... p50) and link them all via a direction called "next" such that "next" links p1 to p2, p2 to p3, ... p49 to p50. As part of the initial game setup put a dummy piece on p1 called "counter". Then whenever you make a move, also move "counter" in the "next" direction. Then base your draw condition on having "token" present on p50.
Mariano Moran Fougerat (Marianomf)
New member
Username: Marianomf

Post Number: 50
Registered: 10-2013
Posted on Sunday, November 10, 2013 - 1:42 am:   

Thats so creative, thank u Im sure this will work
Mariano Moran Fougerat (Marianomf)
New member
Username: Marianomf

Post Number: 51
Registered: 10-2013
Posted on Sunday, November 10, 2013 - 2:06 am:   

Thats so creative, thank u Im sure this will work
Mariano Moran Fougerat (Marianomf)
New member
Username: Marianomf

Post Number: 52
Registered: 10-2013
Posted on Sunday, November 10, 2013 - 3:01 am:   

Hey man I did it as you said, but a big bug appeared, Black cannot be checked, can u help me figure out what porvokes this? This is the code:
; *** Checkmate with two Rooks
; Edited by Mariano Morán Fougerat
; *** Copyright 2013,11 Zillions Development
; v.2.0.1
; Visit the Zillions web site at http://www.zillions-of-games.com
(version "2.0.1")
(define O-O
( (verify never-moved?)
e ; KB1
(verify empty?)
e ; KN1
(verify empty?)
cascade
e ; KR1
(verify (and friend? (piece? Rook) never-moved?) )
from
back ; K1
; Save expensive not-attacked?s for last
(verify not-attacked?)
e ; KB1
(verify not-attacked?)
to
(set-attribute never-moved? false)
; We could check if KN1 is attacked too, but this isn't
; really necessary since Zillions doesn't allow any moves
; into check
e ; KN1
(set-attribute never-moved? false)
add
)
)

(define O-O-O
( (verify never-moved?)
w ; Q1
(verify empty?)
w ; QB1
(verify empty?)
cascade
w ; QN1
(verify empty?)
w ; QR1
(verify (and friend? (piece? Rook) never-moved?) )
from
back ; K1
; Save expensive not-attacked?s for last
(verify not-attacked?)
w ; Q1
(verify not-attacked?)
to
(set-attribute never-moved? false)
; We could check if KN1 is attacked too, but this isn't
; really necessary since Zillions doesn't allow any moves
; into check
w ; QB1
(set-attribute never-moved? false)
add
)
)
(define leap1 ($1 (verify not-friend?) add) )
(define leap2 ($1 (verify not-friend?)(verify (or (piece? Pawn)(piece? Queen)(piece? Rook)(piece? Rider)(piece? Knight)))add ))
(define leap ($1 (verify empty?)add ))
(define leap3 ($1 (verify not-friend?) add) )
(define Counting ($1 add))
(define slide ($1 (while empty? add $1) (verify not-friend?) add))

(define shift2 ($1 (verify empty?) $2 (verify not-friend?) add) )

(define king-shift ($1 (verify not-friend?) (set-attribute never-moved? false) add) )

(define rook-slide (
$1
(while empty? (set-attribute never-moved? false) add $1)
(verify not-friend?)
(set-attribute never-moved? false)
add
))
(define slide1 (
$1
(while not-empty? add $1)
(verify not-friend?)(verify (or (piece? Pawn)(piece? Queen)(piece? Rook)(piece? Rider)(piece? Knight)))add
))
(define Rook-moves
(rook-slide n)
(rook-slide s)
(rook-slide e)
(rook-slide w)
)
(define King-moves
(king-shift n)
(king-shift e)
(king-shift s)
(king-shift w)
(king-shift ne)
(king-shift nw)
(king-shift se)
(king-shift sw)
)
(define Pawn-add
(if (in-zone? promotion-zone) (add Knight Rider Rook Queen) else (if (in-zone? promotion-zone1) (add Knight Rider Rook Queen) else add) )
)
(define Counter-moves
(Counting n)
)
(define Board-Definitions-8x8
(image "Tablero.bmp")
(grid
(start-rectangle 5 5 53 53)
(dimensions
("a/b/c/d/e/f/g/h" (49 0)) ; files
("8/7/6/5/4/3/2/1" (0 49)) ; ranks
)
(directions (n 0 -1) (ne 1 -1) (nw -1 -1)(nee 2 -1)
(nww -2 -1)(neee 3 -1) (nwww -3 -1) (neeee 4 -1)(nwwww -4 -1)(neeeee 5 -1) (nwwwww -5 -1)
(neeeeee 6 -1) (nwwwwww -6 -1)(neeeeeee 7 -1) (nwwwwwww -7 -1)

(nn 0 -2)(nne 1 -2) (nnw -1 -2)(nnne 1 -3) (nnnw -1 -3)(nnnne 1 -4) (nnnnw -1 -4)(nnnnne 1 -5) (nnnnnw -1 -5)(nnnnnne 1 -6) (nnnnnnw -1 -6)
(nnnnnnne 1 -7) (nnnnnnnw -1 -7)



(s 0 1) (se 1 1) (sw -1 1)(see 2 1)
(sww -2 1)(seee 3 1) (swww -3 1) (seeee 4 1)(swwww -4 1)(seeeee 5 1) (swwwww -5 1)
(seeeeee 6 1) (swwwwww -6 1)(seeeeeee 7 1) (swwwwwww -7 1)

(sse 1 2)(ssw -1 2)(ss 0 2)(ssse 1 3) (sssw -1 3)(sssse 1 4) (ssssw -1 4)(ssssse 1 5) (sssssw -1 5)(sssssse 1 6) (ssssssw -1 6)
(ssssssse 1 7) (sssssssw -1 7)

(w -1 0)(ww -2 0)(www -3 0)(wwww -4 0)(wwwww -5 0)(wwwwww -6 0)(wwwwwww -7 0)
(e 1 0)(ee 2 0)(eee 3 0)(eeee 4 0)(eeeee 5 0)(eeeeee 6 0)(eeeeeee 7 0)
(ss 0 2)(sss 0 3)(ssss 0 4)(sssss 0 5)(ssssss 0 6)(sssssss 0 7)
(nn 0 -2)(nnn 0 -3)(nnnn 0 -4)(nnnnn 0 -5)(nnnnnn 0 -6)(nnnnnnn 0 -7)



)
)
(positions
(Z1 530 0 570 40)
(Z2 530 40 570 80)
(Z3 530 80 570 160)
(Z4 530 120 570 200)
(Z5 530 160 570 240)
(Z6 530 200 570 280)
(Z7 530 240 570 320)
(Z8 530 280 570 360)
(Z9 530 320 570 400)
(Z10 530 360 570 440)
(Z11 530 400 570 480)
(Z12 530 440 570 520)
(Z13 530 480 570 560)
(Z14 530 520 570 600)
(Z15 530 560 570 640)
(Z16 530 600 570 680)
(Z17 530 640 570 720)
(Z18 530 680 570 760)
(Z19 530 720 570 800)
(Z20 530 760 570 840)
(Z21 530 800 570 880)
(Z22 530 840 570 920)
(Z23 530 880 570 960)
(Z24 530 920 570 1000)
(Z25 530 960 570 1040)
(Z26 530 1000 570 1080)
(Z27 530 1040 570 1120)
(Z28 530 1080 570 1160)
(Z29 530 1120 570 1200)
(Z30 530 1160 570 1240)
(Z31 530 1200 570 1280)
(Z32 530 1240 570 1320)
(Z33 530 1280 570 1360)
(Z34 530 1320 570 1400)
(Z35 530 1360 570 1440)
(Z36 530 1400 570 1480)
(Z37 530 1440 570 1520)
(Z38 530 1480 570 1560)
(Z39 530 1520 570 1600)
(Z40 530 1560 570 1640)
(Z41 530 1600 570 1680)
(Z42 530 1640 570 1720)
(Z43 530 1680 570 1760)
(Z44 530 1720 570 1800)
(Z45 530 1760 570 1840)
(Z46 530 1800 570 1880)
(Z47 530 1840 570 1920)
(Z48 530 1880 570 1960)
(Z49 530 1920 570 2000)
(Z50 530 1960 570 2040)
)
(links n (Z1 Z2)(Z2 Z3)(Z3 Z4)(Z4 Z5)(Z5 Z6)(Z6 Z7)(Z7 Z8)(Z8 Z9)(Z9 Z10)(Z10 Z11)(Z11 Z12)(Z12 Z13)(Z13 Z14)(Z14 Z15)(Z15 Z16)(Z16 Z17)(Z17 Z18)
(Z18 Z19)(Z19 Z20)(Z20 Z21)(Z21 Z22)(Z22 Z23)(Z23 Z24)(Z24 Z25)(Z25 Z26)(Z26 Z27)(Z27 Z28)(Z28 Z29)(Z29 Z30)
(Z30 Z31)(Z31 Z32)(Z32 Z33)(Z33 Z34)(Z34 Z35)(Z35 Z36)(Z36 Z37)(Z37 Z38)(Z38 Z39)(Z39 Z40)(Z40 Z41)(Z41 Z42)(Z42 Z43)(Z43 Z44)(Z44 Z45)
(Z45 Z46)(Z46 Z47)(Z47 Z48)(Z48 Z49)(Z49 Z50))
(symmetry Black (n s)(s n) (nw sw)(sw nw) (ne se)(se ne))
(zone
(name promotion-zone)
(players White)
(positions b8 c8 d8 e8 f8 g8 h8)
)
(zone
(name promotion-zone)
(players Black)
(positions b1 c1 d1 e1 f1 g1 h1)
)
(zone
(name fifth-rank)
(players White)
(positions a3 b3 c3 d3 e3 f3 g3 h3)
)
(zone
(name fifth-rank)
(players Black)
(positions a6 b6 c6 d6 e6 f6 g6 h6)
)
(zone
(name fourth-rank)
(players White)
(positions a4 b4 c4 d4 e4 f4 g4 h4)
)
(zone
(name fourth-rank)
(players Black)
(positions a5 b5 c5 d5 e5 f5 g5 h5)
)
(zone
(name promotion-zone1)
(players White)
(positions a8 h8)
)
(zone
(name promotion-zone1)
(players Black)
(positions a1 h1)
)
(zone
(name Center)
(players White)
(positions e6 f6 g6 h6)
)
(zone
(name Center)
(players Black)
(positions e7 f7 g7 h7)
)
)
(game
(title "Checkmate with two Rooks")
(description "Game version (version 1.0)Edited by Mariano Morán
RULES

1-Black has the King, and White the King an both Rooks")
(history "It's for practicing Chess skills")
(strategy "Checkmate easily the Black King")
(music "Sounds\Opening.mid")
(win-sound "Sounds\Win.wav")
(loss-sound "Sounds\G.wav")
(click-sound "Audio\Pickup.wav")
(move-sound "Audio\Metal3.wav")
(release-sound "Audio\WoodThunk.wav")
(capture-sound "Audio\Click3.wav")
(change-sound "Audio\WoodThunk.wav")
(players White Black Dummy_player)
(turn-order White Black Dummy_player)
(board (Board-Definitions-8x8))


(board-setup
(White
(Rook a1 h1)
(King e1)
)
(Black
(King e8)
)
(Dummy_player
(Counter Z1)
)
)
(piece
(name King)
(help "King: moves one square to all directions")
(description "King\A King moves one square to all directions.")
(notation "K") ; Short for King
(image White "images\ROYALCHESS\WKing.bmp"
Black "images\ROYALCHESS\BKing.bmp")
(attribute never-moved? true)
(moves
(move-type normaltype)
(King-moves)
(O-O)
(O-O-O)
)
)


(piece
(name Rook)
(notation "R") ; Short for Rook
(help "Rook: moves and throws giant rocks horizontally and vertically to all their rows or columns, and captures the pieces between its zone")
(description "moves like horizontally or vertically all empty rows or columns and captures the pieces between its zone.")
(image White "images\ROYALCHESS\WRook.bmp"
Black "images\ROYALCHESS\BRook.bmp")
(attribute never-moved? true)
(moves
(move-type normaltype)
(Rook-moves)
)
)
(piece
(name Counter)
(notation "C"); Short for Counter
(help "Counter: moves north, counts the game, when it is on Z50 the game is considered a draw")
(description "moves north to count")
(moves
(move-type normaltype)
(Counter-moves)
)
)



(loss-condition (Black)(checkmated King))
(loss-condition (White)(checkmated King))
(draw-condition (White Black) stalemated)
(draw-condition (Dummy_player)(absolute-config Counter (Z50)))
(draw-condition (White)(pieces-remaining 0 Rook))
(draw-condition (White Black) repetition)
)
Greg Schmidt (Gschmidt2)
New member
Username: Gschmidt2

Post Number: 175
Registered: 1-2007
Posted on Sunday, November 10, 2013 - 4:31 am:   

I didn't look at your code in detail, but I have a theory. In order for a white rook to put a black rook into check, the white rook would move to a position in which it would also be attacked by the black rook. I think your code is preventing you from moving into a position where you would be attacked by the opposing rook (e.g. (verify not-attacked?)). In other words, moving to a position which attacks an opposing rook, also causes your rook to be attacked by the opposing rook and I think you might be preventing that.
Mariano Moran Fougerat (Marianomf)
New member
Username: Marianomf

Post Number: 53
Registered: 10-2013
Posted on Sunday, November 10, 2013 - 4:36 am:   

I know how to solve it, im going to forget the links i have another idea to h¿get the draw
Mariano Moran Fougerat (Marianomf)
New member
Username: Marianomf

Post Number: 54
Registered: 10-2013
Posted on Sunday, November 10, 2013 - 4:44 am:   

i Fixed it
Mariano Moran Fougerat (Marianomf)
New member
Username: Marianomf

Post Number: 55
Registered: 10-2013
Posted on Sunday, November 10, 2013 - 4:46 am:   

Instead of a dummy positions i put in turn order 50 times W and B and then the Dummy piece with an only move north on a J file, I killed other positions, so when he moves north its a draw
Greg Schmidt (Gschmidt2)
New member
Username: Gschmidt2

Post Number: 176
Registered: 1-2007
Posted on Sunday, November 10, 2013 - 3:07 pm:   

There are many ways to do it. Either way, you need 50 of something unless you build a 6 bit counter (which is possible in Zillions). What you described above seems like a better solution.
Andreas Speiger (Andique)
New member
Username: Andique

Post Number: 19
Registered: 11-2007
Posted on Sunday, November 10, 2013 - 7:03 pm:   

I don't think, this will work right, because the 50-move-rule only works, if a pawn don't move or a knight, bishop, rook or queen is not captured. You must implement this in the zrf.
M Winther (Kalroten)
New member
Username: Kalroten

Post Number: 159
Registered: 1-2007
Posted on Sunday, November 10, 2013 - 7:55 pm:   

I see no point in implementing the 50-move rule, since it won't affect Zillions' play (unlike the three-move repetition rule). You can see for yourself that it is a draw by the 50-move rule. The program needn't keep count of it.
/Mats
Mariano Moran Fougerat (Marianomf)
New member
Username: Marianomf

Post Number: 57
Registered: 10-2013
Posted on Sunday, November 10, 2013 - 10:04 pm:   

yes that was the only contra, thats why I decided not to implement it on the game

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action: