(game "Lights Out" (players 1) (equipment { (board (square 5)) (piece "Light" Shared) }) (rules (start (place Random {"Light"} count:(value Random (range 10 20)))) (play (move Select (from (sites Board)) (then (forEach Site (sites Around (last To) Orthogonal includeSelf:True) (if (is Occupied (site)) (remove (site)) (add (piece "Light") (to (site))) ) ) ) ) ) (end { (if (all Sites (sites Board) if:(is Empty (site))) (result Mover Win)) (if (= 98 (counter)) (result Mover Loss)) }) ) ) //------------------------------------------------------------------------------ (metadata (info { (description "Lights Out is an electronic game released by Tiger Electronics in 1995.") (rules "The game consists of a 5 by 5 grid of lights. When the game starts, some lights are switched on. Pressing any of the lights will toggle it and the four adjacent lights. The goal of the puzzle is to switch all the lights off, preferably in as few button presses as possible. Ludii allows 100 moves maximum before losing.") (id "1777") (source "Wikipedia") (version "1.3.13") (classification "puzzle/planning") (credit "Eric Piette") (date "1995") } ) (graphics { (piece Colour "Light" fillColour:(colour Yellow)) (board Colour Phase0 (colour 0 102 0)) (board Colour OuterEdges (colour Black)) (board Colour InnerEdges (colour Black)) }) (ai "Lights Out_ai" ) )