Skip to content

package number_shoot_out game#10

Open
sbellem wants to merge 1 commit intolibby:masterfrom
sbellem:pkg-numbershoot-script
Open

package number_shoot_out game#10
sbellem wants to merge 1 commit intolibby:masterfrom
sbellem:pkg-numbershoot-script

Conversation

@sbellem
Copy link
Collaborator

@sbellem sbellem commented Jul 21, 2018

The goal here is to make it as easy as possible for people to try out the game.

This PR packages the number shoot out game such that someone can get the game by simply running

pip install --process-dependency-links git+https://github.com/sbellem/ic3_mpc.git

The above installs the dependencies (viff, twisted, gmpy) and makes generate-config-files.py and number_shoot_out.py available as scripts.

Eventually we could upload the game on PyPI, so that it could be installed with a simpler command, e.g.:

pip install ic3_mpc

todo

  • add some docs
  • package the launch script to start all 3 players in tmux windows

to try the PR, you can do everything in one docker container:

(shell 1) installation

$ docker run --rm -it --name mpc-numbershootout python:2-stretch bash                                                 
apt update && apt install -y libgmp-dev
pip install --process-dependency-links git+https://github.com/sbellem/ic3_mpc.git@pkg-numbershoot-script

(shell 1) config generation

generate-config-files.py -n 3 localhost:9001 localhost:9002 localhost:9003

(shell 1) player 1

mpc-numbershootout --no-ssl player-1.ini
Seeding random generator with random seed 5768
Not using SSL
Listening on port 9001
Will connect to <Player 2: localhost:9002>
Will connect to <Player 3: localhost:9003>

(shell 2) player 2

$ docker exec -it mpc-numbershootout bash 
mpc-numbershootout --no-ssl player-2.ini
Seeding random generator with random seed 3103 
Not using SSL          
Listening on port 9002 
Will connect to <Player 3: localhost:9003>

(shell 3) player 3

$ docker exec -it mpc-numbershootout bash 
mpc-numbershootout --no-ssl player-3.ini
Seeding random generator with random seed 966  
Not using SSL          
Listening on port 9003 
Player's lives [True, True, True] 
You are Player 3 
There are 3 player in this game.
Enter a secret number for you opponent to guess (1 - 20):

@sbellem sbellem requested a review from libby July 21, 2018 00:37
@sbellem sbellem changed the title package number shoot out game package number_shoot_out game Jul 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant