(define "CheckLineRightSubGame" (if (is In (to) (sites "Square0")) (all Sites (sites "Square0") if:(!= (id #1 Neutral) (what at:(site)))) (if (is In (to) (sites "Square1")) (all Sites (sites "Square1") if:(!= (id #1 Neutral) (what at:(site)))) (if (is In (to) (sites "Square2")) (all Sites (sites "Square2") if:(!= (id #1 Neutral) (what at:(site)))) (if (is In (to) (sites "Square3")) (all Sites (sites "Square3") if:(!= (id #1 Neutral) (what at:(site)))) (if (is In (to) (sites "Square4")) (all Sites (sites "Square4") if:(!= (id #1 Neutral) (what at:(site)))) (if (is In (to) (sites "Square5")) (all Sites (sites "Square5") if:(!= (id #1 Neutral) (what at:(site)))) (if (is In (to) (sites "Square6")) (all Sites (sites "Square6") if:(!= (id #1 Neutral) (what at:(site)))) (if (is In (to) (sites "Square7")) (all Sites (sites "Square7") if:(!= (id #1 Neutral) (what at:(site)))) (all Sites (sites "Square8") if:(!= (id #1 Neutral) (what at:(site)))) ) ) ) ) ) ) ) ) ) (define "AddPiece" (move Add (piece (id #1 Neutral)) (to (sites Empty) if:(and { (all Sites (sites Row (row of:(to))) if:(!= (id #1 Neutral) (what at:(site)))) (all Sites (sites Column (column of:(to))) if:(!= (id #1 Neutral) (what at:(site)))) ("CheckLineRightSubGame" #1) }) ) ) ) //------------------------------------------------------------------------------ (game "Duidoku" (players 2) (equipment { (board (square 9)) (piece "1" Neutral) (piece "2" Neutral) (piece "3" Neutral) (piece "4" Neutral) (piece "5" Neutral) (piece "6" Neutral) (piece "7" Neutral) (piece "8" Neutral) (piece "9" Neutral) (regions "Square0" (sites { 0..2 9..11 18..20})) (regions "Square1" (sites { 3..5 12..14 21..23})) (regions "Square2" (sites { 6..8 15..17 24..26})) (regions "Square3" (sites {27..29 36..38 45..47})) (regions "Square4" (sites {30..32 39..41 48..50})) (regions "Square5" (sites {33..35 42..44 51..53})) (regions "Square6" (sites {54..56 63..65 72..74})) (regions "Square7" (sites {57..59 66..68 75..77})) (regions "Square8" (sites {60..62 69..71 78..80})) }) (rules (play (or { ("AddPiece" "1") ("AddPiece" "2") ("AddPiece" "3") ("AddPiece" "4") ("AddPiece" "5") ("AddPiece" "6") ("AddPiece" "7") ("AddPiece" "8") ("AddPiece" "9") }) ) (end { (if (all Sites (sites Board) if:(is Occupied (site))) (result Mover Draw)) ("BlockWin") }) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "Duidoku is a two-player version of Sudoku. ") (rules "The player to play the last possible legal move wins the game. The other player loses. Unless, that is, the board is completely full, in which case the game is a tie.") (id "1774") (source "www.duidoku.com/") (version "1.3.14") (classification "board/space/blocking") (author "Rudd Zwolinski") (credit "Eric Piette") (date "2008") } ) (graphics { (board Style Sudoku) (player Colour Neutral (colour 0 0 0 0)) }) (ai "Duidoku_ai" ) )