You are not logged in. login register
Game Qyshinsu
name Qyshinsu
creator admin
number of roles 2
stylesheet qyshinsu/qyshinsu.xsl
GDL v1
enabled
matches show matches
statistics show game statistics
description A 2 player abstract strategy game where the piece you play constrains where the opponent can play.
Full Description as PDF

The game was created by Rodney A. Frederickson and can be ordered as board game on his website.

GDL by: Ethan Dreyfuss

Game Description

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Qyshinsu
;;; 
;;;  A 2 player abstract strategy game where the piece you play constrains 
;;;  where the opponent can play.
;;;
;;;  Full Description: http://www.rafrederickson.com/Qyshinsu_Guidelines.pdf
;;;
;;;  GDL by: Ethan Dreyfuss
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ROLE Relations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(role black)
(role red)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; INIT Relations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(init (position 1 empty))
(init (position 2 empty))
(init (position 3 empty))
(init (position 4 empty))
(init (position 5 empty))
(init (position 6 empty))
(init (position 7 empty))
(init (position 8 empty))
(init (position 9 empty))
(init (position 10 empty))
(init (position 11 empty))
(init (position 12 empty))

(init (control black))
(init (step 1))

(init (legalPlayLoc 1))
(init (legalPlayLoc 2))
(init (legalPlayLoc 3))
(init (legalPlayLoc 4))
(init (legalPlayLoc 5))
(init (legalPlayLoc 6))
(init (legalPlayLoc 7))
(init (legalPlayLoc 8))
(init (legalPlayLoc 9))
(init (legalPlayLoc 10))
(init (legalPlayLoc 11))
(init (legalPlayLoc 12))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; LEGAL Relations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= (legal ?player (add ?pos ?stone))
    (true (control ?player))
    (true (position ?pos empty))
    (true (legalPlayLoc ?pos))
	(isStone ?stone)
    (not (alreadyTwoOf ?stone))
    (not (currentPlayerRemovedLastTurn ?stone ?pos)))
    
(<= (legal ?player (remove ?pos ?stone))
    (true (control ?player))
    (true (owner ?pos ?player))
    (true (legalPlayLoc ?pos))
	(true (position ?pos ?stone)))
    
(<= (legal red noop)
    (true (control black)))
(<= (legal black noop)
    (true (control red)))
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; NEXT Relations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= (next (control red))
	(true (control black)))
	
(<= (next (control black))
	(true (control red)))
	
(<= (next (step ?stepNum))
	(true (step ?oldStep))
	(succ ?oldStep ?stepNum))

(<= (next (owner ?pos ?player))
	(true (owner ?pos ?player))
	(true (position ?pos ?stone))
	(not (does ?player (remove ?pos ?stone))))

(<= (next (owner ?pos ?player))
	(does ?player (add ?pos ?stone)))

(<= (next (position ?pos empty))
	(true (position ?pos empty))	
	(not (stoneAddedToPos ?pos)))

(<= (stoneAddedToPos ?pos)
	(does ?player (add ?pos ?stone)))
	
(<= (next (position ?pos ?stone))
	(isStone ?stone)
	(true (position ?pos ?stone))
	(not (stoneRemovedFromPos ?pos)))
	
(<= (stoneRemovedFromPos ?pos)
	(does ?player (remove ?pos ?stone)))
    
(<= (next (position ?pos empty))
    (does ?player (remove ?pos ?stone)))
    
(<= (next (position ?pos ?stone))
    (does ?player (add ?pos ?stone)))
	
;;Add or remove normal stone
;;(Note that because diff is undefined for (diff ?x ?x), ?stone cannot be the old stone
(<= (next (legalPlayLoc ?pos))
	(isNumber ?pos)
	(does ?player (add ?pos2 ?stone))
	(diff ?pos ?pos2 ?stone))
	
(<= (next (legalPlayLoc ?pos))
	(isNumber ?pos)
	(does ?player (remove ?pos2 ?stone))
	(diff ?pos ?pos2 ?stone))
	
;;OldStoneAdded Condition
(<= (next (legalPlayLoc ?pos))
	(isNumber ?pos)
	(isOldStone ?stone)
	(does ?player (add ?pos2 ?stone))
	(closestEmptyPosition ?pos2 ?pos))

;;OldStoneRemoved Condition	
(<= (next (legalPlayLoc ?pos))
	(isNumber ?pos)
	(isOldStone ?stone)
	(does ?player (remove ?pos2 ?stone))
	(role ?player2)
	(distinct ?player ?player2)
	(closestPlayerOccupiedPosition ?player2 ?pos2 ?pos))
	
(<= (next oldStoneAdded)
	(does ?player (add ?pos ?stone))
	(isOldStone ?stone)
	(isNumber ?pos)
	(role ?player))

(<= (next oldStoneRemoved)
	(does ?player (remove ?pos ?stone))
	(isOldStone ?stone)
	(isNumber ?pos)
	(role ?player))
	
(<= (next (redPlayerRemovedLastTurn ?stone ?pos))
	(does red (remove ?pos ?stone)))
	
(<= (next (redPlayerRemovedLastTurn ?stone ?pos))
	(true (redPlayerRemovedLastTurn ?stone ?pos))
	(true (control black)))
	
(<= (next (blackPlayerRemovedLastTurn ?stone ?pos))
	(does black (remove ?pos ?stone)))
	
;;If it's red turn propogate the black player's last move
(<= (next (blackPlayerRemovedLastTurn ?stone ?pos))
	(true (blackPlayerRemovedLastTurn ?stone ?pos))
	(true (control red)))
	
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; GOAL Relations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= (goal red 100)
    redWin)
(<= (goal red 0)
    (not redWin))
    
(<= (goal black 100)
    blackWin)
(<= (goal black 0)
	(not blackWin))
		
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; TERMINAL Relations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= terminal 
    redWin)
(<= terminal
    blackWin)
(<= terminal
	(true (step 50)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; View Definitions
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(<= (currentPlayerRemovedLastTurn ?stone ?pos)
	(true (redPlayerRemovedLastTurn ?stone ?pos))
	(true (control red)))
	
(<= (currentPlayerRemovedLastTurn ?stone ?pos)
	(true (blackPlayerRemovedLastTurn ?stone ?pos))
	(true (control black)))

(<= (closestEmptyPosition ?pos1 ?pos2)
	(true (position ?pos2 empty))
	(isNumber ?pos1)
	(isNumber ?pos2)	
	(distinct ?pos1 ?pos2)
	(not (closerEmptyPosition ?pos1 ?pos2)))
		 
(<= (closerEmptyPosition ?pos1 ?pos2)
	(true (position ?pos3 empty))
	(isNumber ?pos1)
	(isNumber ?pos2)
	(isNumber ?pos3)
	(distinct ?pos3 ?pos1)
	(distinct ?pos3 ?pos2)	
	(diff ?pos1 ?pos2 ?a)
	(diff ?pos1 ?pos3 ?b)
	(less ?b ?a))
	
(<= (closestPlayerOccupiedPosition ?player ?pos1 ?pos2)
	(true (owner ?pos2 ?player))
	(isNumber ?pos1)
	(isNumber ?pos2)
	(role ?player)
	(distinct ?pos1 ?pos2)
	(not (closerPlayerOccupiedPosition ?player ?pos1 ?pos2)))
	
(<= (closerPlayerOccupiedPosition ?player ?pos1 ?pos2)
	(true (owner ?pos3 ?player))
	(isNumber ?pos1)
	(isNumber ?pos2)
	(isNumber ?pos3)
	(role ?player)
	(distinct ?pos3 ?pos2)
	(distinct ?pos3 ?pos1)
	(diff ?pos1 ?pos2 ?a)
	(diff ?pos1 ?pos3 ?b)
	(less ?b ?a))
	
(<= (alreadyTwoOf ?stone)
	(true (position ?pos1 ?stone))
	(true (position ?pos2 ?stone))
	(distinct ?pos1 ?pos2))

(<= redWin
	(not (hasLegalMove black))
	(true (control black)))
	
(<= blackWin
	(not (hasLegalMove red))
	(true (control red)))
	
(<= (hasLegalMove ?player)
	(role ?player)
	(isNumber ?pos)
	(isStone ?stone)
	(legal ?player (add ?pos ?stone)))
	
(<= (hasLegalMove ?player)
	(role ?player)
	(isNumber ?pos)
	(isStone ?stone)
	(legal ?player (remove ?pos ?stone)))
	
(<= (next (hadLegalMove ?player))
	(hasLegalMove ?player))
	
;;;;;;;;;;;;;;;;;
;;;;;;;MATH;;;;;;
;;;;;;;;;;;;;;;;;

(<= (less ?x ?y)
	(N++ ?x ?a)
	(less ?a ?y))
	
(<= (less ?x ?y)
	(N++ ?x ?y))
	
;;Normal ++, not modular
(N++ 1 2) (N++ 2 3) (N++ 3 4) (N++ 4 5) (N++ 5 6) 

(<= (diff ?x ?y 1)
	(++ ?x ?y))
	
(<= (diff ?x ?y 1)
	(++ ?y ?x))
	
(<= (diff ?x ?y 2)
	(+2 ?x ?y))
	
(<= (diff ?x ?y 2)
	(+2 ?y ?x))

(<= (diff ?x ?y 3)
	(+3 ?x ?y))
	
(<= (diff ?x ?y 3)
	(+3 ?y ?x))
	
(<= (diff ?x ?y 4)
	(+4 ?x ?y))
	
(<= (diff ?x ?y 4)
	(+4 ?y ?x))
	
(<= (diff ?x ?y 5)
	(+5 ?x ?y))
	
(<= (diff ?x ?y 5)
	(+5 ?y ?x))
	
(<= (diff ?x ?y 6)
	(+6 ?x ?y))
	
(<= (diff ?x ?y 6)
	(+6 ?y ?x))

(<= (+6 ?x ?y)
	(+5 ?x ?c)
	(++ ?c ?y))

(<= (+5 ?x ?y)
	(+4 ?x ?c)
	(++ ?c ?y))

(<= (+4 ?x ?y)
	(+3 ?x ?c)
	(++ ?c ?y))

(<= (+3 ?x ?y)
	(+2 ?x ?c)
	(++ ?c ?y))

(<= (+2 ?x ?y)
	(++ ?x ?c)
	(++ ?c ?y))
    
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Static Relations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(isStone 0) (isOldStone 0)
(isStone 1) (isNotOldStone 1)
(isStone 2) (isNotOldStone 2)
(isStone 3) (isNotOldStone 3)
(isStone 4) (isNotOldStone 4)
(isStone 5) (isNotOldStone 5)

(isNumber 1) (isNumber 2) (isNumber 3) (isNumber 4) (isNumber 5) (isNumber 6) (isNumber 7) (isNumber 8) (isNumber 9) (isNumber 10) (isNumber 11) (isNumber 12)

(++ 1 2)  (++ 2 3)  (++ 3 4)  (++ 4 5)  (++ 5 6)  (++ 6 7)  (++ 7 8)  (++ 8 9)  (++ 9 10)  (++ 10 11)  (++ 11 12)  (++ 12 1)

(succ  1  2) (succ  2  3) (succ  3  4) (succ  4  5) (succ  5  6) 
(succ  6  7) (succ  7  8) (succ  8  9) (succ  9 10) (succ 10 11)
(succ 11 12) (succ 12 13) (succ 13 14) (succ 14 15) (succ 15 16)
(succ 16 17) (succ 17 18) (succ 18 19) (succ 19 20) (succ 20 21)
(succ 21 22) (succ 22 23) (succ 23 24) (succ 24 25) (succ 25 26)
(succ 26 27) (succ 27 28) (succ 28 29) (succ 29 30) (succ 30 31)
(succ 31 32) (succ 32 33) (succ 33 34) (succ 34 35) (succ 35 36)
(succ 36 37) (succ 37 38) (succ 38 39) (succ 39 40) (succ 40 41)
(succ 41 42) (succ 42 43) (succ 43 44) (succ 44 45) (succ 45 46)
(succ 46 47) (succ 47 48) (succ 48 49) (succ 49 50) (succ 50 51)
(succ 51 52) (succ 52 53) (succ 53 54) (succ 54 55) (succ 55 56)
(succ 56 57) (succ 57 58) (succ 58 59) (succ 59 60) (succ 60 61)
(succ 61 62) (succ 62 63) (succ 63 64) (succ 64 65) (succ 65 66)
(succ 66 67) (succ 67 68) (succ 68 69) (succ 69 70) (succ 70 71)
(succ 71 72) (succ 72 73) (succ 73 74) (succ 74 75) (succ 75 76)
(succ 76 77) (succ 77 78) (succ 78 79) (succ 79 80) (succ 80 81)
(succ 81 82) (succ 82 83) (succ 83 84) (succ 84 85) (succ 85 86)
(succ 86 87) (succ 87 88) (succ 88 89) (succ 89 90) (succ 90 91)
(succ 91 92) (succ 92 93) (succ 93 94) (succ 94 95) (succ 95 96)
(succ 96 97) (succ 97 98) (succ 98 99) (succ 99 100)( base oldstoneremoved )
( base control ( val black red ) )
( base position ( val 1 2 3 4 5 6 7 8 9 10 11 12 ) ( val 0 1 2 3 4 5 empty ) )
( base oldstoneadded )
( base redplayerremovedlastturn ( val 0 1 2 3 4 5 empty ) ( val 1 2 3 4 5 6 7 8 9 10 11 12 ) )
( base owner ( val 1 2 3 4 5 6 7 8 9 10 11 12 ) ( val black red ) )
( base legalplayloc ( val 1 2 3 4 5 6 7 8 9 10 11 12 ) )
( base step ( val 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ) )
( base blackplayerremovedlastturn ( val 0 1 2 3 4 5 empty ) ( val 1 2 3 4 5 6 7 8 9 10 11 12 ) )
( base hadlegalmove ( val black red ) )

sees_XML(...) rules

(<= (sees_xml random ?t) (true ?t))
(<= (sees_xml ?p ?t) (role ?p) (distinct ?p random) (true ?t))