Re: [Tutor] Online Rock Paper Sizzors

2007-06-22 Thread ALAN GAULD
Forwarding back to list

- Original Message 
From: Amadeo Bellotti [EMAIL PROTECTED]
To: Alan Gauld [EMAIL PROTECTED]
Sent: Friday, 22 June, 2007 3:22:18 AM
Subject: Re: [Tutor] Online Rock Paper Sizzors

no this isn't a home work assignment. Ive never done web programming before i 
am pretty skilled in python i dont want an application like on a web browser. i 
want a client that each person can download. honestly i have no clue where to 
start with a web app once i get started i can probably take over


On 6/21/07, Alan Gauld [EMAIL PROTECTED] wrote:
Amadeo Bellotti [EMAIL PROTECTED] wrote

 any body know where i start with this I want to be able to enter
 user names and keep score for the persons wins and loses anybody 
 know how i can  do this?

I recommend you write a web application.

There are many web frameworks available in Python from
basic CGI to Zope and all levels in between.

I use TurboGears which includes login and security as

part of the framework.

Now, what else do you not understand? If you ask more specific
questions you will get more specific answers. Also gicve us some
context.Are you an experienced programmer? Are you experienced

in writing web apps in some other language? In Python? At
what point are you stuck?

Or is it a homework assignment? If so we need to see your
attempts before giving hints.

HTH,

--
Alan Gauld

Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


___
Tutor maillist  -  
Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor






___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online Rock Paper Sizzors

2007-06-22 Thread Kent Johnson
 From: Amadeo Bellotti [EMAIL PROTECTED]
 
 no this isn't a home work assignment. Ive never done web programming 
 before i am pretty skilled in python i dont want an application like on 
 a web browser. i want a client that each person can download. honestly i 
 have no clue where to start with a web app once i get started i can 
 probably take over

A downloadable client is an application like any other. Since you know 
Python you can start with that. You can use the pickle module to keep a 
list of high scores.

Why do you call this a web app if it is downloadable? How will it be 
different from a standalone application? If you want the high scores to 
be shared between different users you will have to make the application 
talk to a server of some kind. A simple way to do this is by making 
requests to a web server. You could also use XML-RPC. Python has modules 
to support both of these.

Kent

 
 On 6/21/07, *Alan Gauld* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 Amadeo Bellotti [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote
 
   any body know where i start with this I want to be able to enter
   user names and keep score for the persons wins and loses anybody
   know how i can  do this?
 
 I recommend you write a web application.
 
 There are many web frameworks available in Python from
 basic CGI to Zope and all levels in between.
 
 I use TurboGears which includes login and security as
 part of the framework.
 
 Now, what else do you not understand? If you ask more specific
 questions you will get more specific answers. Also gicve us some
 context.Are you an experienced programmer? Are you experienced
 in writing web apps in some other language? In Python? At
 what point are you stuck?
 
 Or is it a homework assignment? If so we need to see your
 attempts before giving hints.
 
 HTH,
 
 --
 Alan Gauld
 Author of the Learn to Program web site
 http://www.freenetpages.co.uk/hp/alan.gauld
 
 
 ___
 Tutor maillist  -   Tutor@python.org mailto:Tutor@python.org
 http://mail.python.org/mailman/listinfo/tutor
 
 
 
 
 
 
 ___
 Tutor maillist  -  Tutor@python.org
 http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online Rock Paper Sizzors

2007-06-22 Thread Alan Gauld
 From: Amadeo Bellotti [EMAIL PROTECTED]
 no this isn't a home work assignment.

Ok, Just checking :-)

 Ive never done web programming before i am pretty skilled
 in python i dont want an application like on a web browser.

OK, That would have been the simplest form of online game but...

 i want a client that each person can download.

OK, I assume from this that you want a multi player
game - for rock,paper,scissors I assume multi = 2? - rather
than just an interactive game against the computer?

 honestly i have no clue where to start with a web app

OK, If we are going for a networked game between
multiple users you have a choice to run a server centrally
with all clients connecting to that or to run on a peer to per
basis with the two participating machines forming a direct
connection. The latter is easy to program for the game
but more complex to set up the initial configuration. A
central server makes the game slightly more comlex
but setup is easier.

I'd probably opt for the server approach but keep it really
simple initially. Only allow two connections and simply
relay the results. This can all be done using simple
sockets (see my network programming topic on my tutor).

The sequence will be something like:

server awaiting connections
client A connects, server gives back (empty) list of other clients
client B connects,
server notifies all clients of user list
client B challenges A (or vice versa)
server notifies A that he has been challenged
A accepts and server henceforth refuses any more connections
server asks players to select a weapon
clients send responses
server compares responses and sends notification to both cliernts of 
score
repeat for as many turns as desired then report final score
open up for more connections
client C connects
server notifies all clients of new user list
client A challenges C
repeat as above...

Hopefully that's enough to give you somne ideas and get started.
Once you get that working you can enhance it to support multiple
games at once etc. Keep high scores, league tables etc etc.
Also you can introduce security with logins etc.

But get the basic game structure working first.

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online Rock Paper Sizzors

2007-06-22 Thread Amadeo Bellotti

thank you very much ill start on it right away its just going to be a text
based game client cause i want it to work on my old computer Pentium 1

On 6/22/07, Alan Gauld [EMAIL PROTECTED] wrote:


 From: Amadeo Bellotti [EMAIL PROTECTED]
 no this isn't a home work assignment.

Ok, Just checking :-)

 Ive never done web programming before i am pretty skilled
 in python i dont want an application like on a web browser.

OK, That would have been the simplest form of online game but...

 i want a client that each person can download.

OK, I assume from this that you want a multi player
game - for rock,paper,scissors I assume multi = 2? - rather
than just an interactive game against the computer?

 honestly i have no clue where to start with a web app

OK, If we are going for a networked game between
multiple users you have a choice to run a server centrally
with all clients connecting to that or to run on a peer to per
basis with the two participating machines forming a direct
connection. The latter is easy to program for the game
but more complex to set up the initial configuration. A
central server makes the game slightly more comlex
but setup is easier.

I'd probably opt for the server approach but keep it really
simple initially. Only allow two connections and simply
relay the results. This can all be done using simple
sockets (see my network programming topic on my tutor).

The sequence will be something like:

server awaiting connections
client A connects, server gives back (empty) list of other clients
client B connects,
server notifies all clients of user list
client B challenges A (or vice versa)
server notifies A that he has been challenged
A accepts and server henceforth refuses any more connections
server asks players to select a weapon
clients send responses
server compares responses and sends notification to both cliernts of
score
repeat for as many turns as desired then report final score
open up for more connections
client C connects
server notifies all clients of new user list
client A challenges C
repeat as above...

Hopefully that's enough to give you somne ideas and get started.
Once you get that working you can enhance it to support multiple
games at once etc. Keep high scores, league tables etc etc.
Also you can introduce security with logins etc.

But get the basic game structure working first.

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Online Rock Paper Sizzors

2007-06-21 Thread Amadeo Bellotti

any body know where i start with this I want to be able to enter user names
and keep score for the persons wins and loses anybody know how i can do
this?
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Online Rock Paper Sizzors

2007-06-21 Thread Alan Gauld
Amadeo Bellotti [EMAIL PROTECTED] wrote

 any body know where i start with this I want to be able to enter 
 user names
 and keep score for the persons wins and loses anybody know how i can 
 do
 this?

I recommend you write a web application.

There are many web frameworks available in Python from
basic CGI to Zope and all levels in between.

I use TurboGears which includes login and security as
part of the framework.

Now, what else do you not understand? If you ask more specific
questions you will get more specific answers. Also gicve us some
context.Are you an experienced programmer? Are you experienced
in writing web apps in some other language? In Python? At
what point are you stuck?

Or is it a homework assignment? If so we need to see your
attempts before giving hints.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 


___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor