]>
Softwares of Agnibho - life.git/blob - __main__.py
3 # Agnibho's Game of Life - Python implementation of Conway's Game of Life
4 # Copyright (C) 2014 Agnibho Mondal
6 # This file is part of Agnibho's Game of Life
8 # Agnibho's Game of Life is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # Agnibho's Game of Life is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Agnibho's Game of Life. If not, see <http://www.gnu.org/licenses/>.
28 app
. master
. title ( "Conway's Game of Life - Agnibho.com" )
33 width
= int ( sys
. argv
[ 1 ])
34 depth
= int ( sys
. argv
[ 2 ])
36 print "Dimensions must be integer"
38 elif ( len ( sys
. argv
)== 2 ):
41 print "Argument not recognized"
43 if ( width
< 10 or depth
< 10 ):
46 print "Dimensions must be more than 10x10"
48 elif ( width
> app
. winfo_screenwidth ()/ 10 or depth
>( app
. winfo_screenheight ()- 150 )/ 10 ):
51 print "Dimensions are too large to fit in the screen. Maximum allowed dimension " + str ( app
. winfo_screenwidth ()/ 10 )+ "x" + str (( app
. winfo_screenheight ()- 150 )/ 10 )
54 app
. render ( width
, depth
)
56 app
. parsefile ( filename
)