## Tsuro Game
Implementation of board game Tsuro with Java
- Gino Wang - ginowang.sh@u.northwestern.edu
- Jennifer Liu - jenniferliu2018@u.northwestern.edu
- Jin Han - jinhan2019@u.northwestern.edu
## Test
Run all unit tests:
- If you are in `./`, simply run with `make test` or `make`.
Run with test-play-a-turn:
- Run with `./test-play-a-turn play-a-turn` to check against the game rule with Robby's code.
- Use `./test-play-a-turn -h` to see options such as number of games to run and enable verbose display on console.
Run a unit test suite:
- Better to compile first with `make`.
- Then run with `java -jar lib/junit-platform-console-standalone-1.2.0.jar --class-path bin/ -c TESTNAME`.
- You would need to specific package for the `TESTNAME` - see *Run from command line* section for more.
Run in IntelliJ IDEA:
- Open project with IntelliJ -> Right click on the folder `test/` -> Click "Run All Test".
## GUI
- Compile and run all unit tests with `make`.
- Run `java -cp bin/ tsuro.Tsuro 10086 1 3 2 2 0`, which starts a local tournament with 1 HPlayer, 3 MPlayerRandom, 2 MPlayerMostSym, and 2 MPlayerLeastSym, the number, e.g. `10086`, is the port number any remote players can connect to should you want to add any to the tournament.
- In a new terminal, run `java -cp bin/ tsuro.admin.App` to join the tournament as the HPlayer. This should fire up the GUI.
We still need to implement the case when a HPlayer tries to place pawn at an illegal starting position or to commit an illegal move.
## Tournament over network
Start a network client:
- Make sure that the server is already running, either a local or remote host.
- In `./`, run `java -cp bin/ tsuro.admin.Admin Port_Number Player_Name Player_Type(H/M) Strategy(R/MS/LS)` - only add Strategy if `Player_Type = M` - to connect with the host to join the tournament.
Start a server to run tournament:
- Run `java -cp bin/ tsuro.Tsuro Port_Number Number_of_HPlayer Number_of_MPlayerRandom Number_of_MPlayerMostSym Number_of_MPlayerLeastSym Number_of_RemotePlayer` to start a local server which starts a tournament with number and type of players as specified.
## Launch from command line
Best to compile everything first with `make`.
To run a single class from command line, use `java -cp bin/ PACKAGENAME.CLASSNAME arg1 arg2 ...` where `arg` is the input into the main function in the class specified by `CLASSNAME`.
- Package `tsuro` contains all Tsuro game element definition classes and their tests.
- Package `tsuro.parser` contains all parser classes that support network and their unit tests.
- Package `tsuro.admin` contains local network localhost server and client definition classes.
没有合适的资源?快使用搜索试试~ 我知道了~
tsuro-game:用Java实现经典棋盘游戏Tsuro
共152个文件
class:49个
java:42个
jar:22个
需积分: 5 2 下载量 3 浏览量
2021-05-13
07:27:09
上传
评论
收藏 21.31MB ZIP 举报
温馨提示
鹤游戏 用Java实现棋盘游戏Tsuro 王(Gino Wang) 刘珍妮 金汉 测试 运行所有单元测试: 如果您在./ ,只需运行make test或make 。 试一试: ./test-play-a-turn play-a-turn运行./test-play-a-turn play-a-turn和Robby的代码来检查游戏规则。 使用./test-play-a-turn -h查看选项,例如运行的游戏数并在控制台上启用详细显示。 运行单元测试套件: 最好先用make进行编译。 然后使用java -jar lib/junit-platform-console-standalone-1.2.0.jar --class-path bin/ -c TESTNAME 。 您需要针对TESTNAME特定程序包-有关更多信息,请参见从命令行运行部分。 在IntelliJ IDE
资源详情
资源评论
资源推荐
收起资源包目录
tsuro-game:用Java实现经典棋盘游戏Tsuro (152个子文件)
Server.class 12KB
ParserTest.class 10KB
Parser.class 9KB
DragonTest.class 9KB
MPlayerTest.class 8KB
HPlayer.class 7KB
ServerPlayATurnTest.class 6KB
ServerTest.class 6KB
PlayTurnController.class 5KB
Admin.class 5KB
BoardParserTest.class 4KB
PawnParser.class 4KB
RemotePlayer.class 4KB
BoardParser.class 4KB
TileTest.class 4KB
BoardTest.class 4KB
Deck.class 4KB
Board.class 4KB
PlacePawnController.class 4KB
ServerLegalPlayTest.class 4KB
DeckTest.class 4KB
PawnParserTest.class 4KB
SPlayerParser.class 3KB
PlayATurnAdapter.class 3KB
Tile.class 3KB
SPlayerParserTest.class 3KB
MPlayer.class 3KB
Token.class 3KB
SPlayer.class 3KB
APlayer.class 2KB
StartGameController.class 2KB
TileParser.class 2KB
TileParserTest.class 2KB
App.class 2KB
AdminSocket.class 1KB
HPlayerTest.class 1KB
PlacePawnController$Side.class 1KB
EndGameController.class 1021B
APlayer$State.class 932B
MPlayerLeastSym.class 879B
MPlayerKA.class 877B
MPlayerMostSym.class 846B
MPlayerRandom.class 788B
Token$1.class 713B
Tile$SymmetricComparator.class 667B
Pair.class 664B
Tsuro.class 661B
Tile$1.class 635B
Tile$ListFirstElementComparator.class 617B
.DS_Store 14KB
PlacePawn.fxml 13KB
PlacePawn.fxml 13KB
PlayTurn.fxml 4KB
PlayTurn.fxml 4KB
StartGame.fxml 2KB
StartGame.fxml 2KB
EndGame.fxml 2KB
EndGame.fxml 2KB
.gitignore 23B
Tsuro-Game.iml 2KB
scenebuilder-8.4.1-all.jar 9.3MB
scenebuilder-8.4.1-all.jar 9.3MB
junit-platform-console-standalone-1.2.0.jar 1.45MB
junit-platform-console-standalone-1.2.0.jar 1.45MB
junit-4.12.jar 308KB
junit-4.12.jar 308KB
junit-jupiter-api-5.2.0.jar 106KB
junit-jupiter-api-5.2.0.jar 106KB
junit-platform-commons-1.2.0.jar 76KB
junit-platform-commons-1.2.0.jar 76KB
junit-jupiter-api-5.0.0.jar 74KB
junit-jupiter-api-5.0.0.jar 74KB
junit-platform-commons-1.0.0.jar 61KB
junit-platform-commons-1.0.0.jar 61KB
hamcrest-core-1.3.jar 44KB
hamcrest-core-1.3.jar 44KB
opentest4j-1.1.0.jar 7KB
opentest4j-1.1.0.jar 7KB
opentest4j-1.0.0.jar 6KB
opentest4j-1.0.0.jar 6KB
apiguardian-api-1.0.0.jar 2KB
apiguardian-api-1.0.0.jar 2KB
Server.java 20KB
ParserTest.java 16KB
Parser.java 15KB
DragonTest.java 13KB
MPlayerTest.java 11KB
ServerPlayATurnTest.java 10KB
PawnParser.java 8KB
BoardParserTest.java 7KB
ServerTest.java 7KB
Board.java 7KB
HPlayer.java 7KB
Tile.java 6KB
ServerLegalPlayTest.java 5KB
Admin.java 5KB
PlayTurnController.java 4KB
BoardParser.java 4KB
PawnParserTest.java 4KB
Deck.java 4KB
共 152 条
- 1
- 2
cestZOE
- 粉丝: 21
- 资源: 4547
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0