The position before move in the previ... Log Out | Topics | Search
Moderators | Register | Edit Profile

Zillions of Games Discussion Forum » Designing Games for Zillions » The position before move in the previous own turn « Previous Next »

Author Message
Shigeki Watanabe (Watanabe)
New member
Username: Watanabe

Post Number: 3
Registered: 3-2018
Posted on Saturday, March 10, 2018 - 3:32 pm:   

Keyword "last-from?" compares the position to the starting position of the last move.
Keyword "last-to?" compares the position to the destination of the last move or drop.

There is Chess with turn order in white - black - white.
When using the keyword "last-from?" in the 2nd white turn, it returns the position in the previous black turn.

Is there any good idea if I want to return the position in the previous white turn?

Turn order: Player - Piece) position before move >> position after move
1: White - Pawn) "e2" >> e4
2: Black - Pawn) d7 >> d6
3: White - Bishop) c1 >> f4 (current turn)

Move block in the current turn (3rd turn order; 2nd White turn)
"from" - c1
"to" - f4

"last-from" - d7 << This position can be get by the keyword "last-from?".
"last-to" - d6 << This position can be get by the keyword "last-to?".

I want to get the position "e2" in the move bock of 2nd White turn (current turn).
This "e2" is the starting postion of 1st white turn (previous own turn).

With "last-from?", I can only get the position "d7" of 1st black turn.
Shigeki Watanabe (Watanabe)
New member
Username: Watanabe

Post Number: 8
Registered: 3-2018
Posted on Thursday, March 15, 2018 - 4:42 am:   

I strongly desire to introduce the keywords "second-last-to?" and "second-last-from?", becuase I want to check if the current position is the position at the previous own turn.
Greg Schmidt (Gschmidt2)
New member
Username: Gschmidt2

Post Number: 190
Registered: 1-2007
Posted on Thursday, April 05, 2018 - 3:12 am:   

It's been a while since I've written zrf code, but I wonder if you can create a second "hidden" board using dummy pieces and positions. Whenever white makes a move, maybe you can also place the piece on the dummy board location. There would be some details to work out, but this might be a direction for you to pursue.
Shigeki Watanabe (Watanabe)
New member
Username: Watanabe

Post Number: 17
Registered: 3-2018
Posted on Thursday, April 05, 2018 - 12:01 pm:   

Thank you for your reply.

I succeeded in preserving the "second from last" position as a rank and a file by using two dummy pieces.

/discus/messages/4/1760.html?1522654949

I created "Triple Move Shogi" that a player moves three different pieces in own turn.

http://www.zillions-of-games.com/cgi-bin/zilligames/submissions.cgi?do=show;id=2677

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: