basic display of goban works, playing not yet possible. skeleton for game deletion inserted.
This commit is contained in:
parent
298faf0a92
commit
ece81b8695
6 changed files with 72 additions and 14 deletions
29
playgame.py
Normal file
29
playgame.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
import goban,helper,psql
|
||||
|
||||
def main(req,form):
|
||||
"""
|
||||
display selected goban and manage user input.
|
||||
"""
|
||||
req.write(str(form.keys())+"<hr>")
|
||||
|
||||
gamename = form["game"]
|
||||
#do stuff
|
||||
data = helper.header()
|
||||
|
||||
#read goban table from database
|
||||
tmplist = psql.read_table(gamename)
|
||||
#make a dictionary out of the list
|
||||
gobandict = psql.fetchall_list_to_goban_dict(tmplist)
|
||||
#print goban
|
||||
#data += "<p> Turn number: %s, %s Player's Move.</p>" % (gobandict["turn_number"],("White","Black")[gobandict["turn_number"] % 2]) #eleet ;>
|
||||
|
||||
#check whether its our turn
|
||||
#if yes: print 'your move' and display goban and process move
|
||||
#if not: print '...s move' and display goban.
|
||||
|
||||
|
||||
|
||||
data += goban.display_goban(gobandict,req,form)
|
||||
data += helper.footer()
|
||||
req.write(data)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue