-- MergeGames.hs -- Tom Moertel -- CVS $Id: MergeGames.hs,v 1.5 2002/09/09 05:07:14 thor Exp $ -- | The MergeGames program is a filter that accepts any number of -- Games as input, merges the games, and prints the resulting -- unified Game as output. module Main (main) where import Game import GetInput main :: IO () main = do interactDefault $ mergeAndShow . map read . lines where mergeAndShow :: [Game] -> String mergeAndShow [] = "" mergeAndShow [g] = unlines [show g] mergeAndShow gs = unlines [show $ foldl1 mergeGames gs] -- ================================================================= -- -- Copyright (C) 2002 Thomas Moertel. -- -- This program is free software; you can redistribute it and/or -- modify it under the terms of the GNU General Public License -- as published by the Free Software Foundation; either version 2 -- of the License, or (at your option) any later version. -- -- The text of the GNU GPL may be found in the LICENSE file, -- included with this software, or online at the following URL: -- -- http://www.gnu.org/copyleft/gpl.html -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- Except as provided for under the terms of the GNU GPL, all rights -- are reserved worldwide. -- -- =================================================================