Turn-based game - experimental economics

Hendrik van Rooyen hendrik at microcorp.co.za
Sat Sep 5 12:00:36 EDT 2009


On Saturday 05 September 2009 12:07:59 Paolo Crosetto wrote:

8<-----------------------------------------------
>
> The problem I now face is to organise turns. Players, as in Scrabble, will
> play in turns. So far I have developed the server and ONE client, and
> cannot get my head round to - nor find many examples of - how to simply
> develop a turn-based interaction.
8<------------------------------

>
> Does anyone have any hints?

Why do you not just write a loop, giving each player a turn?

keep a list of players.

for player in players:
    tell_her_to_respond(player)
    ans = get_the_answer(player)
    update_all(player,ans)

This is of course very basic, as it needs stuff like timeouts.
But maybe it can get you started.

HTH - Hendrik




More information about the Python-list mailing list