Welcome to Play Games with R using the NWS Server Technology!
The R package 'gamesNWS' provides an infrastructure to play different
card games (e.g. uno, poker) in a computer network. You can play the games with your friends
in the whole world or against several computer players at your local machine.
For the communication a NetWorkSpace Server and the R package NWS is used.
Just install a NWS Server, send the login data to your friends and start the game.
How to play a game?
Everyone has to install the 'gamesNWS' and 'NWS' package.
- install.packages("gamesNws",repos="http://R-Forge.R-project.org")
- install.packages("nws")
Than a master user (one of the players) is required:
- First of all you need a running NWS Server. The installation is quite simple: http://nws-r.sourceforge.net/
- A master player has to create the game (e.g. an Uno game): startUnoGame('MyGame', serverHost='localhost')
Than all players have to connect to the same server (e.g. a Uno game): playUno('MyGame', serverHost='localhost', user='username')
The rest is quite simple and will be explained during the game.
Example code for UNO:
Start three R sessions
For all:
- install.packages("gamesNws", repos="http://R-Forge.R-project.org")
- library(gamesNws)
Console 1:
- startUnoGame('exampleWorkSpace', serverHost='localhost', config=c(T,T,T,T))
Console 2:
- playUnoGame('exampleWorkSpace', serverHost='localhost', user='exampleplayer1')
Console 3:
- playUnoGame('exampleWorkSpace', serverHost='localhost', user='exampleplayer2')
Console 1:
- Enter s to start the game.
Console 2 or 3: In default you will get a GUI.
If you play with the command line, depending on the played card, you can play one of the following commands:
- get-info (shows some game-relevant information)
- NO (if you don't want or can't play a card)
- color-value (plays one of your hand cards)
Implemented Games:
ToDo's
- Provide NWS-Game Server for everyone
- Implement second game: POKER
- Chat
How to add further games to the 'gamesNWS' package?
ToDo
The project summary page you can find here.