Giter Site home page Giter Site logo

talhaahussain / card-game Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 260 KB

Continuous Assessment for ECM2414 - Software Development, set by Prof. Yulei Wu (Year 2, Semester 1). Uses multi-threading in Java to simulate the playing of a simple card game with numerous players and decks. Developed as a pair programming project.

License: MIT License

Java 100.00%
card-game java parallel-computing

card-game's Introduction

card-game

Continuous Assessment for ECM2414 - Software Development, set by Prof. Yulei Wu (Year 2, Semester 1). Uses multi-threading in Java to simulate the playing of a simple card game with numerous players and decks. Developed as a pair programming project.

This work received a final mark of 91/100.

Please see specification.pdf for specification.

Compiling the main program

To compile the main program, do:

javac CardGame.java

Creating a JAR file

To create a JAR file containing the main program, first recompile the program. Then, do:

jar -cfe cards.jar CardGame *

Running the main program

To run the main program, do:

java CardGame

Alternatively, to run from the JAR file, do:

java -jar cards.jar

You will be prompted to input the number of players and then be asked to provide the location of a pack file. Please note that only .txt files are accepted, with all card denominations on a new line, with no whitespace or strings or any other symbols. If the executable tells you that there is a problem with your pack file, please check again and ensure that none of these illegal characters are appearing anywhere.

When referencing the pack file, you may use an absolute or relative filepath. Please note that in order to simply reference the file by name (e.g., simply using "pack.txt"), you must make sure that the pack file sits in the same directory as the .class compiled files or the .jar executable. If there are problems with this, please revert to using the absolute path of the desired pack file.

Testing

The tests are written using JUnit 4. junit.jar and hamcrest-core.jar are provided in the submission to run the tests.

Compiling the tests

To compile the tests, do:

javac --class-path ".;junit.jar" TestSuite.java

Running the tests

To run all the tests, do:

java -class-path ".;junit.jar;hamcrest-core.jar" org.junit.runner.JUnitCore TestSuite

TestSuite is a class that runs all the tests.

Footnotes

When viewing the deck files after a game, it is possible that some decks may have more/less cards. This is normal and to be expected - due to the nature of the multithreaded environment, the game may suddenly end while certain decks have less cards than others.

Please note that the number of players is decided by the user and the pack should be provided by the user as well.

Developed by Talhaa Hussain and Reuben Kurian for the University of Exeter, module code ECM2414.

card-game's People

Contributors

talhaahussain avatar

Watchers

 avatar

Forkers

reubensgithub

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.