| Author |
Message |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 1 Registered: 4-2008
| | Posted on Friday, April 25, 2008 - 2:28 pm: | |
Hi, I'm working on a simple chess based game, where the players each drop a nightrider anywhere on the board. After that, the players alternate moving their nightrider. When a nightrider moves from a square he leaves behind his banner to show he's already claimed that space. Ok here is the deal, I can make the game work for knight only, but not the nightrider (a piece that moves like a knight, but can continue its movement)... Anyone who can help me? Or it could be much better if I just could send the game to you, if you can fix it... Thanks, yalik... |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 59 Registered: 1-2007
| | Posted on Saturday, April 26, 2008 - 12:32 am: | |
In the Fairy Chess zrf in the Zillions standard games there is nightrider code. Mats |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 6 Registered: 4-2008
| | Posted on Saturday, April 26, 2008 - 3:25 am: | |
Yes, You are right! But my trouble is writing definition (just one) when after move of Nightrider it marks square where it was. For Knight it is look like "(define conquest ( (verify empty?) mark $1 (verify friend?) (verify (piece? Knight)) (change-type Banner) back add) )".I want something like this for Nightrider. If you can help me! |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 61 Registered: 1-2007
| | Posted on Saturday, April 26, 2008 - 5:54 am: | |
A nightrider can maximally make two jumps in a row on a standard board so you don't need a while loop for the night rider. Just insert the code for the knight (above) on the first jump and then you write the same code again for the second jump, but skip the part where square is marked. Mats |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 9 Registered: 4-2008
| | Posted on Saturday, April 26, 2008 - 10:04 am: | |
O key I will try, thank you! |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 11 Registered: 4-2008
| | Posted on Saturday, April 26, 2008 - 12:21 pm: | |
OK, I tried that, but it seems to me, that I'm doing something wrong... Is it possible for you to write down the code for me, please? yalik |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 65 Registered: 1-2007
| | Posted on Saturday, April 26, 2008 - 3:41 pm: | |
I don't know. Maybe something like this: $1 $1 $1 $2 (change-type marker) add $1 $1 $1 $2 (add-copy nightrider) I don't know if the above will work. But don't be in such a hurry. It takes time to master Zillions. Mats |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 13 Registered: 4-2008
| | Posted on Saturday, April 26, 2008 - 4:30 pm: | |
Thank You very much! I will try! |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 14 Registered: 4-2008
| | Posted on Sunday, April 27, 2008 - 5:25 am: | |
Hi Mats! This is Nightrider move definition. (define available (verify (and not-friend? )) ) (define leap2ride ($1 $2 (while empty? add $1 $2 ) (available) add)) but unfortunately to mark square where Nightrider was after move I think it is very very hard. I did many cods but they don't work!!! |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 66 Registered: 1-2007
| | Posted on Sunday, April 27, 2008 - 2:23 pm: | |
I forgot that the nightrider is a contnuous knight. Of course it can be done. But forget the while clause. Instead, insert three knight moves after one another. It's no hurry. Work on something else in the mean time. Soon a solution will pop up in your head. Mats |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 16 Registered: 4-2008
| | Posted on Sunday, April 27, 2008 - 3:08 pm: | |
O key Thanks! |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 67 Registered: 1-2007
| | Posted on Monday, April 28, 2008 - 12:04 am: | |
I don't know if this is exactly what you want, but this nightrider code will leave a marker on the first jumped square if the nightrider jumps to the second or third square. (define nightrider-leap ( $1 (verify not-friend?) add (create Marker) $1 (verify not-friend?) add $1 (verify not-friend?) to (opposite $1) (opposite $1) (create Marker) add )) Mats |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 68 Registered: 1-2007
| | Posted on Monday, April 28, 2008 - 12:12 am: | |
By the way, we must check that it's empty too, before jumping to next square. Here is the code: (define nightrider-leap ( $1 (verify not-friend?) add (verify empty?) (create Marker) $1 (verify not-friend?) add (verify empty?) $1 (verify not-friend?) to (opposite $1) (opposite $1) (create Marker) add ))
|
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 17 Registered: 4-2008
| | Posted on Monday, April 28, 2008 - 12:01 pm: | |
It is working very good! But one remark -Nightrider mark not square it was before jumping but first square on the way! Can you a little change this cod? Nightrider must mark square where it located after jumping!!! Any way Thank You Mats!!!!! |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 18 Registered: 4-2008
| | Posted on Monday, April 28, 2008 - 12:05 pm: | |
It is working very good! But one remark - the Nightrider does not mark the square it moved from, but the next one. Can you change this code a little? Any way Thank You Mats! |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 19 Registered: 4-2008
| | Posted on Monday, April 28, 2008 - 12:13 pm: | |
I forget to say Nightriders can not captures each other. |
M Winther (Kalroten)
New member Username: Kalroten
Post Number: 69 Registered: 1-2007
| | Posted on Monday, April 28, 2008 - 12:27 pm: | |
Then you can do like this (probably not the most effeicient code). (define nightrider-leap ( $1 (verify not-friend?) mark (go from) (create Marker) back add (verify empty?) $1 (verify not-friend?) mark (go from) (create Marker) back add (verify empty?) $1 (verify not-friend?) mark (go from) (create Marker) back add )) Mats |
Marc Dahl (Yalik)
New member Username: Yalik
Post Number: 20 Registered: 4-2008
| | Posted on Monday, April 28, 2008 - 3:23 pm: | |
This is exactly what I wished. Thank you very much Mats. |