#!/usr/bin/python #---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ import string import kw_cgi import ascii import evaluate import scenarios #---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ class Map(kw_cgi.CGI): def header( self, title, id ): print ( '\n' 'Settlers of Catan: %s map (%d)\n' '\n' '\n' 'Settlers of Catan: %s map (%d)\n' '
' ) % \ (title, id, title, id) def footer( self ): print '' print '' def action( self ): map = string.lower( self.get_arg( 'map', 'normal' ) ) id = string.atoi( self.get_arg( 'id', '0' ) ) eval= string.lower( self.get_arg( 'eval', '' ) ) l = ascii.ASCII() if map == 'expansion': b = scenarios.Expansion( l, id ) self.header( '5-6 player', b.seed ) elif map == 'bigisland': b = scenarios.BigIsland( l, id ) self.header( '7-8 player', b.seed ) else: b = scenarios.Normal( l, id ) self.header( '3-4 player', b.seed ) print '
'
		b.draw()
		print '
' if eval: print '
' print '
'
			e = evaluate.Simple( b )
			e.evaluate()
			print '
' self.footer() #---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ Map()