GithubHelp home page GithubHelp logo

cs-4500's Introduction

stoic-whales | Group 1


Program A - JSON

Purpose of the Program:

This program has been created to take in one well-formed JSON from STDIN and returns STDOUT as a string. The three main cases are as follows:
       1) Any dictionary keys are not returned
       2) All non key integers are replaced with the string "number"
       3) All non key strings are returned without any manipulation
The program can be run on command line with the prompt ./xjson followed by the JSON STDIN.

Tests:

A single test was created following the n-in.json and n-out.json method specified in the homework assignment directions
(we assigned n to be 0). A n-in.json test can be fed into ./xjson by running ./xjson < Tests/n-in.json

The files can be found in the Tests folder. File path: stoic-whales/A/Tests.

Directory Organization:

NOT all files and folders are presented in this display. The focus is on the location of the code, java jar, json library, and xjson.iml file.

  • code: stoic-whale/A/Other/src/Main.java
  • java jar: stoic-whale/A/Other/A.jar
  • json library: stoic-whale/A/Other/lib/jackson-core-2.14.0.jar
  • xjson.iml: stoic-whale/A/Other/xjson.iml
                                   stoic-whales
                                        |
         ________________________________________________
           |             |           |                 |                 
        .idea        .vscode         A              ReadMe.md
                                     |
                        _____________________
                          |       |        |         
                        Other   Tests    xjson
                          |       |___________________________________________
             __________________________________________________      _________|_________
                |         |         |          |            |           |           |
             .idea       lib       src       A.jar      xjson.iml    0-in.json   0-out.json
                          |         |
                          |     _____________________
                          |         |          |
                          |       .DS_Store   Main.java
             __________________________________
              |           |
          .DS_Store   jackson-core-2.14.0.jar  
 

Program B - GUI

Purpose of the Program:

This program takes in a well-formed and valid JSON STDIN input and outputs an image of all the specified tiles side by side. The image is then saved into the directory with the given file name and then prints the string "Done" once the image has been saved. After that visual que, the user is then able to enter in another well-formed and valid STDIN and another image will be created and saved (unless the same file name is given which then leads to the new image to replace the old one).
The program can be run on command line with the prompt xvfb-run ./xjson followed by the JSON STDIN.

Tests:

None

Directory Organization:

NOT all files and folders are presented in this display. The focus is on the location of the code, java jar, image folder, javaFX library, and pom.xml file. Due to using maven software with our javaFX GUI we needed to feed in the Jackson library in a pom.xml file

  • code: stoic-whale/B/Other/xgui/src/main/java/com/xgui/Main.java
  • code2: stoic-whale/B/Other/xgui/src/main/java/com/xgui/StartApplication.java
  • java jar: stoic-whale/B/Other/xgui.jar
  • image folder: stoic-whale/B/Other/xgui/images
  • javaFX library: stoic-whale/A/Other/lib/...
  • pom.xml: stoic-whale/B/Other/xgui/pom.xml
                          stoic-whales
                               |
  ______________________________________________________________
     |             |         |       |         |            |                 
   .idea        .vscode      A       Q         B         ReadMe.md
                                               |
                            _________________________
                              |        |           |
                            Other   .DS_Store     xgui
                              |
         ___________________________________________________________________
         |              |                               |            |
   .idea/artifacts     lib                            xgui      .DS_Store
                        |                               |
  ______________________|_______________________        |_____________________________________________________       
       |                      |               |             |             |              |          |
 javafx-sdk-20.0.2   javafx-linux-sdk-21    7 more      src/main/java     xgui.jar     images     pom.xml
                                                            |                            |
                                       ________________________________________        30 png
                                          |            |             |
                                        META-INF   com/xgui    moduke-info.java
                                                       |
                                                ___________________________________
                                                    |                 |
                                                Main.java    StartApplication.java
 

Program 2 - The Map

Purpose of the Program At This Stage:

The Q-Game program that is heavily based off the well-known Qwirkle board game is currently in its earliest stage. The purpose of the current program is to present a data representation of the game map that supports 3 functionalities described on the assignment description. They are as follows:
      1) Creating the map with a beginning tile (aka the referee’s tile)
      2) Extend the map with a different tile by placing it beside an already placed tile regardless of the color and shape
      3) Determining all playable moves based on the game state based on a given tile

Folder and Files:

 
Folder Name(s) Filepath Description
Common stoic-whales/Q/Common folder that contains all the java files needed for the program to work, however each file contains only the link to its corresponding file placed in another folder
Planning stoic-whales/Q/Planning contains the state.md file
Q_Game stoic-whales/Q/Q_Game contains all the java files with the code and along with the nested folders (the files that are linked to the ones in the Common folder)
test/java/org/common stoic-whales/Q/Q_Game/src/test/java/org/common contains all the java test files
File Name Filepath Description
Board stoic-whales/Q/Common/Board.java or stoic-whalesQ/Q_Game/src/main/java/org/common/Board.java contains the interface for the map
Map stoic-whales/Q/Common/Map.java or stoic-whalesQ/Q_Game/src/main/java/org/common/Map.java contains the Map class that implements the Board interface
Rule stoic-whales/Q/Common/Rule.java or stoic-whalesQ/Q_Game/src/main/java/org/common/Rule.java contains the interface for the rules pertaining to the game
Rule_Extend_A_Side stoic-whales/Q/Common/Rule_Extend_A_Side.java or stoic-whalesQ/Q_Game/src/main/java/org/common/Rule_Extend_A_Side.java contains the Rule_Extend_A_Side class that implements the Rule interface
Rule_Must_Match_Neighbors stoic-whales/Q/Common/Rule_Must_Match_Neighbors.java or stoic-whalesQ/Q_Game/src/main/java/org/common/Rule_Must_Match_Neighbors.java contains the Rule_Must_Match_Neighbors class that implements the Rule interface
Tile stoic-whales/Q/Common/Tile.java or stoic-whalesQ/Q_Game/src/main/java/org/common/Tile.java contains the Tile interface for the tile pieces
Valid_Tile stoic-whales/Q/Common/Valid_Tile.java or stoic-whalesQ/Q_Game/src/main/java/org/common/Valid_Tile.java contains the Valid_Tile class that implements the Tile interface
Board_Test stoic-whales/Q/Q_Game/src/test/java/org/common/Board_Test.java contains all the tests that exist within the class (ones that support all the required functionalities)
Rule_Extends_A_Side_Test stoic-whales/Q/Q_Game/src/test/java/org/common/Rule_Extends_A_Side_Test.java contains the tests that checks that the methods correctly enforce the rule
Rule_Must_Match_Neighbors_Test stoic-whales/blob/main/Q/Q_Game/src/test/java/org/common/Rule_Must_Match_Neighbors_Test.java contains the tests that checks that the methods correctly enforce the rule
Valid_Tile_Test stoic-whales/blob/main/Q/Q_Game/src/test/java/org/common/Valid_Tile_Test.java making sure Tiles are correctly assembled

Tests:

All tests can be run by running ./x_test

FileName: Board_Test
Filepath: stoic-whales/blob/main/Q/Q_Game/src/test/java/org/common/BoardTest.java
Purpose: Testing the methods that are within the Map class

FileName: Rule_Extends_A_Side_Test
Filepath: stoic-whales/blob/main/Q/Q_Game/src/test/java/org/common/Rule_Extends_A_SideTest.java
Purpose: Making sure the rule is followed all formates of the board

FileName: Rule_Must_Match_Neighbors_Test
Filepath: stoic-whales/blob/main/Q/Q_Game/src/test/java/org/common/Rule_Extends_A_SideTest.java
Purpose: Making sure the rule is followed all formates of the board

FileName: Valid_Tile_Test
Filepath: stoic-whales/blob/main/Q/Q_Game/src/test/java/org/common/Valid_Tile_Test.java
Purpose: Making sure Tiles are correctly assembled

UML Class Diagram:

diagram


Program C - TCP

Purpose of the Program:

This program has been created to take in one well-formed JSON from STDIN sent in by the client and returns STDOUT as a string on the server side. The three main cases are as follows:
       1) Any dictionary keys are not returned
       2) All non key integers are replaced with the string "number"
       3) All non key strings are returned without any manipulation
The program can be run on command line with the prompt ./xtcp followed by joining the localhost server and the the JSON STDIN.

Tests:

Three tests were created following the n-in.json and n-out.json method specified in the homework assignment directions.
A n-in.json test can be fed into ./xtcp by running ./xtcp < Tests/n-in.json

The files can be found in the Tests folder. File path: stoic-whales/C/Tests.

Directory Organization:

NOT all files and folders are presented in this display. The focus is on the location of the code, java jar, json library, and xtcp.iml file.

  • code: stoic-whales/C/Other/.xtcp/src/Main.java
  • code2: stoic-whales/C/Other/.xtcp/src/Json_Parser_A.java
  • code3: stoic-whales/C/Other/.xtcp/src/Server.java
  • java jar: stoic-whales/C/Other/.xtcp/xtcp.jar
  • Json Library: stoic-whales/C/Other/lib/jackson.core-2.14.0
  • xtcp.iml: stoic-whales/C/Other/.xtcp/xtcp.iml
                          stoic-whales
                               |
  ______________________________________________________________
     |             |         |      |       |      |        |                 
   .idea        .vscode      A      B       C      Q    ReadMe.md
                                            |
                               _____________________________________
                                  |      |        |        |
                                .idea  Other    Tests  .DS_Store
                                         |        |
              ___________________________|        |________________________________________________________________
                |     |       |        |              |           |          |        |           |          |
               lib   idea  .DS_Store .xtcp        0-in.json 0-out.json  1-in.json 1-out.json  0-in.json 0-out.json
                |                      |
  ______________|_______________       |______________________________________________________________
    |              |                    |      |      |          |         |              |
.DS_Store   jackson.core-2.14.0        idea   src  .DS_Store  xtcp.iml  xtcp.jar  out/production/xtcp        
                                               |
                                     __________|_______________________________________________________
                                        |          |              |               |            |
                                     META-INF  .DS_Store  Json_Parser_A.java   Main.java   Server.java

Program 3 - The State

Purpose of the Program At This Stage:

The purpose of the current program is to present a data representation of the referee's game state and of the player's information that is given to the player during their turn. Both these representations support the 3 functionalities described on the assignment description. They are as follows:
      1) Extracting the data to be sent to the player during their turn
      2) Completing a turn action
      3) Checking whether a proposed placement by the currently active player satisfies the rules of The Q Game

Folder and Files:

 
Folder Name(s) Filepath Description
Common stoic-whales/Q/Common folder that contains all the java files needed for the program to work. Each file contains only the link to its corresponding file placed in another folder
Planning stoic-whales/Q/Planning contains the player_interface.md file and the other planning memos
Q_Game stoic-whales/Q/Q_Game contains all the java files with the code and along with the nested folders (the files that are linked to the ones in the Common folder)
File Name Filepath Description
Game_State stoic-whales/Q/Q_Game/src/test/java/org/common/Q_Game_State.java contains the interface that represents the referee's game state
Players_Game_State stoic-whales/Q/Q_Game/src/test/java/org/common/Player_Game_State.java the class that allows the referee to send important and relevent information to the player during their turn
Q_Game_State stoic-whales/Q/Q_Game/src/test/java/org/common/Q_Gamr_State.java contains the class that implements the Game_State interface
Tile stoic-whales/Q/Q_Game/src/test/java/org/common/Tile.java We got rid of the Tile interface and refactored the Valid_Tile class to Tile
  • Player: An empty class that will be used to represent individual players in the future

Tests:

All JSON test specific to this phase of the project can be run using the jar file using ./xmap command.

All tests are located in the 3/Tests folder.

UML Class Diagram:

diagram

ambidextrous-mice | Group 2


Milestone 4 - The Score

Purpose of the Added Functionality Program At This Stage:

The purpose of the current program is to equip our game-state component with the following two pieces:
          1) functionality for rendering the current state, including its map, graphically
          2) functionality for scoring a placement (assuming the move is legal)

Folder and Files:

Folder Name(s) Filepath Description
Q ambidextrous-mice/Q contains the Common and Planning folder and their repective files
4/Tests ambidextrous-mice/4/Tests The folderss that contain the Json test files
File Name Filepath Description
Game_State.java ambidextrous-mice/Q/Common/java/src/Game_State.java the class that represents the game state
Game_State_GUI.java ambidextrous-mice/Q/Common/java/src/Game_State_GUI.java the class that handles the visiual representation of the game state
XLegal.java ambidextrous-mice/Q/Common/java/src/XLegal.java class that reads the Json STDIN and returns Json STDOUT (a boolean or JMap)
Test Description.md ambidextrous-mice/4/Tests/Test Description.md a file that explains what is being tested/checked in each test in the Tests folder

Tests:

All JSON test specific to this phase of the project can be run using the jar file using ./xlegal command.

All tests are located in the 4/Tests folder.

UML Class Diagram:

diagram


Milestone 5 - The Strategy

Purpose of the Added Functionality Program At This Stage:

The purpose of the current program is to implement a strategy interface and two concrete variants:
          1) The first one is called dag
          2) The second is called ldasg
The lexicographic ordering on tiles says that tile p is less than tile q if p’s shape is less than q’s. If p’s shape is identical to q’s, p is below q iff p’s color is below q’s. The order of the shapes and colors are:
          Shape: star < 8star < square < circle < clover < diamond
          Color: red < green < blue < yellow > orange < purple
We then equip the strategy component with an iteration functionality. Starting from some game state, the piece of functionality applies a given strategy as far as possible to obtain the longest possible series of placements or a replacement decision or a pass decision.

Tests:

All JSON test specific to this phase of the project can be run using the jar file using ./xscore command.

All tests are located in the 5/Tests folder.

UML Class Diagram:

diagram


Milestone 6 - The Game

Purpose of the Added Functionality Program At This Stage:

The purpose of the current program is to create and implement the referee and players in the program:
          The player should be able to pick a strategy to implement and
          The referee should be able to communicate with the players and game state
           until the game is over. Then they announce the winner(s) and end the game.
As the title implies this compelents the basic operations and comonents for the program to conduct a full game.

Folder and Files:

Folder Name(s) Filepath Description
Referee ambidextrous-mice/Q/Referee contains the referee class
6/Tests ambidextrous-mice/6/Tests The folderss that contain the Json test files
File Name Filepath Description
player.java ambidextrous-mice/Q/Player/player.java the class that represents the players
referee.java ambidextrous-mice/Q/Referee/referee.java the class that represents the referee
XStrategy.java ambidextrous-mice/Q/Player/XStrategy.java class that reads the Json STDIN and returns Json STDOUT (1Placement)

Tests:

All JSON test specific to this phase of the project can be run using the jar file using ./xstrategy command.

All tests are located in the 6/Tests folder.

UML Class Diagram:

diagram


Milestone 7 - The Clean Up

Purpose of the Added Functionality Program At This Stage:

The purpose of the current program is to create and implement the referee and players in the program:
          The player should be able to pick a strategy to implement and
          The referee should be able to communicate with the players and game state
           until the game is over. Then they announce the winner(s) and end the game.
As the title implies this compelents the basic operations and comonents for the program to conduct a full game.

Folder and Files:

Folder Name(s) Filepath Description
Referee ambidextrous-mice/Q/Referee contains the referee class
6/Tests ambidextrous-mice/6/Tests The folderss that contain the Json test files
File Name Filepath Description
player.java ambidextrous-mice/Q/Player/player.java the class that represents the players
referee.java ambidextrous-mice/Q/Referee/referee.java the class that represents the referee
XStrategy.java ambidextrous-mice/Q/Player/XStrategy.java class that reads the Json STDIN and returns Json STDOUT (1Placement)

Tests:

All JSON test specific to this phase of the project can be run using the jar file using ./xstrategy command.

All tests are located in the 6/Tests folder.

UML Class Diagram:

diagram


stoic-armadillos | Group 3


Milestone 8 - The Observer

Purpose of the Added Functionality Program At This Stage:

The purpose of the current program is to create an user interface that represents the game state at every phase of the game if an oberver exists. Its two main features are:
           1. saving the states it receives as PNG files in a directory called Tmp/, naming each image the order in which it was created (ex: 0.png)
           2. displays the states it receives as images in a GUI. This GUI supports the following three interaction capabilities:
                2.1 a next functionality shows the next state of the game, if it is available
                2.2 a previous functionality shows the previous state of the game, if it is available
                2.3 a save functionality saves the current state as an instance of JState in a file of the user’s choice.

Folder and Files:

Folder Name(s) Filepath Description
7/Tests sly-dolphins/7/Tests the folder that contains the JSON test files
File Name Filepath Description
Xgames-with-observer.java sly-dolphins/Q/Referee/Xgames-with-observer.java this class that reads the Json STDIN and returns Json STDOUT
ObservableGameState sly-dolphins/Q/Common/ObservableGameState.java this interface represents the functionality for observing/viewing a game state. Does not include any functionality for modifying the state
game_state sly-dolphins/Q/Common/game_state.java this class now implements the ObservableGameState
JSON_Processor sly-dolphins/Q/Player/xgames-with-observer.java this class contains methods meant for converting JSON to our data representation and vice versa
Observer sly-dolphins/Q/Referee/Observer.java this class that represents an observer of the game
Observer_GUI sly-dolphins/Q/Referee/Observer_GUI.java this class represents the oberver and the GUI interface it uses

Tests:

All JSON test specific to this phase of the project can be run using the jar file using ./xgames-with-observer command.

All tests are located in the 8/Tests folder.

UML Class Diagram:

diagram


Milestone 9 - Remote

Purpose of the Added Functionality Program At This Stage:

The purpose of the current program is to create the functionality that allows for third party players join the game server and play through a game. Once the server is on, players are given 20 seconds to join (with 3 seconds to enter their names) and additional 20 seconds if less then two players join. If less then two players join the server will not start a game and will return the JSON STDIN "[[ ], [ ]]". If two or more players join, the game will starts and play out as expected. If players take to long to complete certain tasks (6 seconds) during the game they will be removed as well. If there are any issues on the server side that disrupts or changes objects within the game, the server will terminate the game and shut down the server.

Folder and Files:

Folder Name(s) Filepath Description
9/Tests stoic-armadillos/9/Tests the folder that contains the JSON test files
Client stoic-armadillos/Q/Client the folder that contains proxy referee and client IPlayer
Server stoic-armadillos/Q/Server the folder that contains proxy player and host server
File Name Filepath Description
xbaddies stoic-armadillos/Q/Referee/xbaddies.java this class that reads the Json STDIN and returns Json STDOUT
DFSStrategy stoic-armadillos/Q/Player/DFSStrategy.java this class is the smart DFS strategy methods a client player should use
referee stoic-armadillos/Q/Client/referee.java the class that represents the proxy referee for players who are connecting to the server
client stoic-armadillos/Q/Client/client.java the class that represents the cilent (aka players) who joins the game server
player stoic-armadillos/Q/Server/player.java the class that represents the proxy player
server stoic-armadillos/Q/Server/server.java the class that starts the server and then starts the game once two or more players join the server

Tests:

All JSON test specific to this phase of the project can be run using the jar file using ./xbaddies command.

All tests are located in the 9/Tests folder.

UML Diagram:

diagram


Milestone 10 - Revised/End

Purpose of the Added Functionality Program At This Stage:

At this point in the process we have finally ready to put everything together. The game is fully functioning and players can join the host server once it has been started. Players can chose one of the three strategies to implement throughout the game.

Folder and Files:

Folder Name(s) Filepath Description
10/Tests stoic-armadillos/10/Tests the folder that contains the JSON test files
File Name Filepath Description
xserver stoic-armadillos/Q/Server/xserver.java this class that reads the Json STDIN and returns Json STDOUT on the Server side
xclient stoic-armadillos/Q/Client/xclient.java this class that reads the Json STDIN and returns Json STDOUT on the Client side
Utils stoic-armadillos/Q/Common/Utils.java contains the various static untility methods that are not specific to a certain data type

Tests:

All JSON test specific to this phase of the project can be run using the jar file using the following command:
    $ ./xserver PortNumber < FileNameForServerConfig &
    $ ./xclients PortNumber < FileNameForClientConfig &

All tests are located in the 10/Tests folder.

UML Diagram:

diagram

Sequence Diagram:

image

cs-4500's People

Contributors

meixia-s avatar

Watchers

 avatar

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.