Supersede users need to press enter after inputting a string in python 3.0

Posted by Cimex on Stack Overflow See other posts from Stack Overflow or by Cimex
Published on 2012-11-22T15:54:05Z Indexed on 2012/11/22 16:59 UTC
Read the original article Hit count: 231

Filed under:
|
|
|
|

I've been attempting to create a simple Rock, Paper, Scissors game in python 3.0 -- very standard task for anybody learning programming.

But, as I finish up to a point, I think,"wow, that'd be awesome", or,"it'd be cool to do this!" So anyways, I keep building upon the project...

I've developed a menu, a single player game vs the computer, and just finished the multiplayer game. But, I've realized, that the multiplayer game isn't very effective. It just dosen't work like the analog version of the game.

Currently, it'll ask for player1's input, then player2's input, compare them, and spit out the result and the current score. What I'd rather have happen is that the program asks for both players input at the same time and both players input their choice at the same time.

I understand that I can easily do that by just grabbing the index of the first and second answer and compare the 2 inputs -- easy. But what I'd rather have happen is that after both players enter their one character answers at the same time (r for rock, p for paper, or s for scissors), then the program will auto enter the input. Not needing someone to press enter.

The input would be dictated by the fact that 2 characters have been entered.

I guess my question is: Is there any way to dictate what can be used as an input for 'enter'?

© Stack Overflow or respective owner

Related posts about python

Related posts about input