diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 00000000..abf76483
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 00000000..a09fa6f9
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 00000000..797acea5
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 00000000..35eb1ddf
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Client/out/production/untitled/Client.class b/Client/out/production/untitled/Client.class
new file mode 100644
index 00000000..a18c9670
Binary files /dev/null and b/Client/out/production/untitled/Client.class differ
diff --git a/Client/src/Client.java b/Client/src/Client.java
new file mode 100644
index 00000000..f2e92449
--- /dev/null
+++ b/Client/src/Client.java
@@ -0,0 +1,60 @@
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.util.Scanner;
+
+public class Client {
+
+ static String host = "192.168.43.6";
+ static int port = 6969;
+ static DataInputStream in;
+ static DataOutputStream out;
+ static Socket socket;
+
+ public static void main(String[] args) {
+
+ Scanner input = new Scanner(System.in);
+ boolean connect = true;
+
+ try {
+ socket = new Socket(host, port);
+ in = new DataInputStream(socket.getInputStream());
+ out = new DataOutputStream(socket.getOutputStream());
+
+ //while (connect) {
+ /*System.out.println("Enter annual interest rate");
+ double annualInterestRate = input.nextDouble();
+
+ System.out.println("Enter number of years");
+ int numOfYears = input.nextInt();
+
+ System.out.println("Enter loan amount");
+ double loanAmount = input.nextDouble();
+
+ out.writeDouble(annualInterestRate);
+ out.writeInt(numOfYears);
+ out.writeDouble(loanAmount);
+
+ */
+ //out.flush();
+
+ // }
+ while(true){
+ String name = input.nextLine();
+ out.writeUTF(name);
+ while(true){
+ String print = in.readUTF();
+ System.out.println(print);
+ }
+
+ }
+
+ } catch (UnknownHostException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/Client/untitled.iml b/Client/untitled.iml
new file mode 100644
index 00000000..9465dd86
--- /dev/null
+++ b/Client/untitled.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GameFx/GameFx.iml b/GameFx/GameFx.iml
new file mode 100644
index 00000000..cf79cfdc
--- /dev/null
+++ b/GameFx/GameFx.iml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GameFx/pom.xml b/GameFx/pom.xml
new file mode 100644
index 00000000..843f3cd3
--- /dev/null
+++ b/GameFx/pom.xml
@@ -0,0 +1,70 @@
+
+
+ 4.0.0
+
+ com.example
+ GameFx
+ 1.0-SNAPSHOT
+ GameFx
+
+
+ UTF-8
+ 5.7.1
+
+
+
+
+ org.openjfx
+ javafx-controls
+ 17-ea+11
+
+
+ org.openjfx
+ javafx-fxml
+ 17-ea+11
+
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ ${junit.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ ${junit.version}
+ test
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
+
+ 17
+ 17
+
+
+
+ org.openjfx
+ javafx-maven-plugin
+ 0.0.6
+
+
+
+ default-cli
+
+ com.example.gamefx/com.example.gamefx.HelloApplication
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/GameFx/src/main/java/com/example/gamefx/HelloApplication.java b/GameFx/src/main/java/com/example/gamefx/HelloApplication.java
new file mode 100644
index 00000000..76493339
--- /dev/null
+++ b/GameFx/src/main/java/com/example/gamefx/HelloApplication.java
@@ -0,0 +1,32 @@
+package com.example.gamefx;
+
+import javafx.application.Application;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+
+
+public class HelloApplication extends Application {
+
+ @Override
+ public void start(Stage stage) throws IOException {
+ // which scene we want to be initially displayed.. load that .fxml file
+ FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("CARDS_AGAINST_MEDIALOGY.fxml"));
+ Scene scene = new Scene(fxmlLoader.load());
+ stage.setTitle("Card Game"); //the title of the window
+ stage.setScene(scene);
+ stage.show();
+ }
+
+ public static void main(String[] args) {
+ launch();
+ }
+
+}
+
+
diff --git a/GameFx/src/main/java/com/example/gamefx/SceneController.java b/GameFx/src/main/java/com/example/gamefx/SceneController.java
new file mode 100644
index 00000000..f3ec106e
--- /dev/null
+++ b/GameFx/src/main/java/com/example/gamefx/SceneController.java
@@ -0,0 +1,51 @@
+package com.example.gamefx;
+
+import javafx.event.ActionEvent;
+import javafx.fxml.FXML;
+import javafx.fxml.FXMLLoader;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.Label;
+import javafx.scene.control.TextField;
+import javafx.stage.Stage;
+
+import java.io.IOException;
+
+public class SceneController {
+ @FXML
+ private Label welcomeText;
+ private Stage stage;
+ private Scene scene;
+ private FXMLLoader fxmlLoader;
+
+ //https://www.youtube.com/watch?v=hcM-R-YOKkQ&ab_channel=BroCode
+ // method to switch scenes
+ @FXML
+ protected void onButtonClick(ActionEvent event) throws IOException {
+ welcomeText.setText("Welcome to JavaFX Application!");
+ //load the correct .fxml file
+ fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("CARDS_AGAINST_MEDIALOGY.fxml"));
+ //cast the source of the event to Node, cast the entire stage to Stage
+ stage = (Stage)((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(fxmlLoader.load());
+ // set the scene to the stage
+ stage.setScene(scene);
+ stage.show(); //display it
+
+
+ }
+
+
+
+ @FXML
+ protected void switchToScene2(ActionEvent event) throws IOException {
+ fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("second-page.fxml"));
+ stage = (Stage)((Node)event.getSource()).getScene().getWindow();
+ scene = new Scene(fxmlLoader.load(), 560, 440);
+ stage.setScene(scene);
+ stage.show();
+
+ }
+
+
+}
\ No newline at end of file
diff --git a/GameFx/src/main/java/module-info.java b/GameFx/src/main/java/module-info.java
new file mode 100644
index 00000000..88833793
--- /dev/null
+++ b/GameFx/src/main/java/module-info.java
@@ -0,0 +1,8 @@
+module com.example.gamefx {
+ requires javafx.controls;
+ requires javafx.fxml;
+
+
+ opens com.example.gamefx to javafx.fxml;
+ exports com.example.gamefx;
+}
\ No newline at end of file
diff --git a/GameFx/src/main/resources/com/example/gamefx/CARDS_AGAINST_MEDIALOGY.fxml b/GameFx/src/main/resources/com/example/gamefx/CARDS_AGAINST_MEDIALOGY.fxml
new file mode 100644
index 00000000..d99364ff
--- /dev/null
+++ b/GameFx/src/main/resources/com/example/gamefx/CARDS_AGAINST_MEDIALOGY.fxml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameFx/src/main/resources/com/example/gamefx/CARDS_FOR_HUMANITY.fxml b/GameFx/src/main/resources/com/example/gamefx/CARDS_FOR_HUMANITY.fxml
new file mode 100644
index 00000000..aac53222
--- /dev/null
+++ b/GameFx/src/main/resources/com/example/gamefx/CARDS_FOR_HUMANITY.fxml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameFx/src/main/resources/com/example/gamefx/hello-view.fxml b/GameFx/src/main/resources/com/example/gamefx/hello-view.fxml
new file mode 100644
index 00000000..97133bb9
--- /dev/null
+++ b/GameFx/src/main/resources/com/example/gamefx/hello-view.fxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameFx/src/main/resources/com/example/gamefx/second-page.fxml b/GameFx/src/main/resources/com/example/gamefx/second-page.fxml
new file mode 100644
index 00000000..379177c2
--- /dev/null
+++ b/GameFx/src/main/resources/com/example/gamefx/second-page.fxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameFx/target/classes/com/example/gamefx/CARDS_AGAINST_MEDIALOGY.fxml b/GameFx/target/classes/com/example/gamefx/CARDS_AGAINST_MEDIALOGY.fxml
new file mode 100644
index 00000000..d99364ff
--- /dev/null
+++ b/GameFx/target/classes/com/example/gamefx/CARDS_AGAINST_MEDIALOGY.fxml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameFx/target/classes/com/example/gamefx/CARDS_FOR_HUMANITY.fxml b/GameFx/target/classes/com/example/gamefx/CARDS_FOR_HUMANITY.fxml
new file mode 100644
index 00000000..aac53222
--- /dev/null
+++ b/GameFx/target/classes/com/example/gamefx/CARDS_FOR_HUMANITY.fxml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameFx/target/classes/com/example/gamefx/HelloApplication.class b/GameFx/target/classes/com/example/gamefx/HelloApplication.class
new file mode 100644
index 00000000..05af5ecb
Binary files /dev/null and b/GameFx/target/classes/com/example/gamefx/HelloApplication.class differ
diff --git a/GameFx/target/classes/com/example/gamefx/SceneController.class b/GameFx/target/classes/com/example/gamefx/SceneController.class
new file mode 100644
index 00000000..54a88729
Binary files /dev/null and b/GameFx/target/classes/com/example/gamefx/SceneController.class differ
diff --git a/GameFx/target/classes/com/example/gamefx/hello-view.fxml b/GameFx/target/classes/com/example/gamefx/hello-view.fxml
new file mode 100644
index 00000000..97133bb9
--- /dev/null
+++ b/GameFx/target/classes/com/example/gamefx/hello-view.fxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameFx/target/classes/com/example/gamefx/second-page.fxml b/GameFx/target/classes/com/example/gamefx/second-page.fxml
new file mode 100644
index 00000000..379177c2
--- /dev/null
+++ b/GameFx/target/classes/com/example/gamefx/second-page.fxml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GameFx/target/classes/module-info.class b/GameFx/target/classes/module-info.class
new file mode 100644
index 00000000..5556a304
Binary files /dev/null and b/GameFx/target/classes/module-info.class differ
diff --git a/MED305.iml b/MED305.iml
new file mode 100644
index 00000000..c60d140b
--- /dev/null
+++ b/MED305.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MP_Client/MP_Client.iml b/MP_Client/MP_Client.iml
new file mode 100644
index 00000000..c90834f2
--- /dev/null
+++ b/MP_Client/MP_Client.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MP_Client/src/Client.java b/MP_Client/src/Client.java
new file mode 100644
index 00000000..e96a89d7
--- /dev/null
+++ b/MP_Client/src/Client.java
@@ -0,0 +1,51 @@
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.util.Scanner;
+
+public class Client {
+
+ static String host = "localhost";
+ static int port = 6969;
+ static DataInputStream in;
+ static DataOutputStream out;
+ static Socket socket;
+
+ public static void main(String[] args) {
+
+ Scanner input = new Scanner(System.in);
+ boolean connect = true;
+
+ try {
+ socket = new Socket(host, port);
+ in = new DataInputStream(socket.getInputStream());
+ out = new DataOutputStream(socket.getOutputStream());
+
+ //while (connect) {
+ /*System.out.println("Enter annual interest rate");
+ double annualInterestRate = input.nextDouble();
+
+ System.out.println("Enter number of years");
+ int numOfYears = input.nextInt();
+
+ System.out.println("Enter loan amount");
+ double loanAmount = input.nextDouble();
+
+ out.writeDouble(annualInterestRate);
+ out.writeInt(numOfYears);
+ out.writeDouble(loanAmount);
+
+ */
+ //out.flush();
+
+ // }
+
+ } catch (UnknownHostException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/Server/Mini-Projekt.iml b/Server/Mini-Projekt.iml
new file mode 100644
index 00000000..9465dd86
--- /dev/null
+++ b/Server/Mini-Projekt.iml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Server/out/production/Mini-Projekt/Card.class b/Server/out/production/Mini-Projekt/Card.class
new file mode 100644
index 00000000..5849f560
Binary files /dev/null and b/Server/out/production/Mini-Projekt/Card.class differ
diff --git a/Server/out/production/Mini-Projekt/ProblemCard.class b/Server/out/production/Mini-Projekt/ProblemCard.class
new file mode 100644
index 00000000..1ab7675a
Binary files /dev/null and b/Server/out/production/Mini-Projekt/ProblemCard.class differ
diff --git a/Server/out/production/Mini-Projekt/ProblemText.class b/Server/out/production/Mini-Projekt/ProblemText.class
new file mode 100644
index 00000000..f67d8879
Binary files /dev/null and b/Server/out/production/Mini-Projekt/ProblemText.class differ
diff --git a/Server/out/production/Mini-Projekt/Server.class b/Server/out/production/Mini-Projekt/Server.class
new file mode 100644
index 00000000..161d29d6
Binary files /dev/null and b/Server/out/production/Mini-Projekt/Server.class differ
diff --git a/Server/out/production/Mini-Projekt/ServerRunnable.class b/Server/out/production/Mini-Projekt/ServerRunnable.class
new file mode 100644
index 00000000..0c22e9a0
Binary files /dev/null and b/Server/out/production/Mini-Projekt/ServerRunnable.class differ
diff --git a/Server/out/production/Mini-Projekt/SolutionCard.class b/Server/out/production/Mini-Projekt/SolutionCard.class
new file mode 100644
index 00000000..4f83476a
Binary files /dev/null and b/Server/out/production/Mini-Projekt/SolutionCard.class differ
diff --git a/Server/out/production/Mini-Projekt/SolutionText.class b/Server/out/production/Mini-Projekt/SolutionText.class
new file mode 100644
index 00000000..4d9390f9
Binary files /dev/null and b/Server/out/production/Mini-Projekt/SolutionText.class differ
diff --git a/Server/src/Card.java b/Server/src/Card.java
new file mode 100644
index 00000000..bc349dd7
--- /dev/null
+++ b/Server/src/Card.java
@@ -0,0 +1,11 @@
+public abstract class Card {
+ private String cardText;
+
+ public String getCardText() {
+ return cardText;
+ }
+
+ public void setCardText(String cardText) {
+ this.cardText = cardText;
+ }
+}
diff --git a/Server/src/Game.java b/Server/src/Game.java
new file mode 100644
index 00000000..1b9024cf
--- /dev/null
+++ b/Server/src/Game.java
@@ -0,0 +1,11 @@
+public class Game {
+ private String gameName;
+
+ Game(String gameName){
+ this.gameName = gameName;
+ }
+
+ public String getGameName() {
+ return gameName;
+ }
+}
diff --git a/Server/src/HandleAGame.java b/Server/src/HandleAGame.java
new file mode 100644
index 00000000..27f0f691
--- /dev/null
+++ b/Server/src/HandleAGame.java
@@ -0,0 +1,38 @@
+import java.util.ArrayList;
+import java.util.Collections;
+
+public class HandleAGame implements Runnable{
+
+
+ @Override
+ public void run() {
+ //Creates a deck of solution cards and adds them in an arraylist
+ ArrayList solutionDeck = new ArrayList<>();
+ for(SolutionText solutionText : SolutionText.values()){
+ solutionDeck.add(new SolutionCard(solutionText.printSolutionText()));
+ }
+
+ //Creates a deck of problem cards and adds them in an arraylist
+ ArrayList problemDeck = new ArrayList<>();
+ for(ProblemText problemText : ProblemText.values()){
+ problemDeck.add(new ProblemCard(problemText.printProblemText()));
+ }
+
+ //Shuffles the two decks
+ Collections.shuffle(solutionDeck);
+ Collections.shuffle(problemDeck);
+
+ //Printing of the deck to check if it works
+ for(int i = 0; i < problemDeck.size();i++)
+ System.out.println(problemDeck.get(i).toString());
+
+ //Printing of the deck to check if it works
+ for(int i = 0; i < solutionDeck.size();i++)
+ System.out.println(solutionDeck.get(i).toString());
+
+
+
+ }
+
+
+}
diff --git a/Server/src/ProblemCard.java b/Server/src/ProblemCard.java
new file mode 100644
index 00000000..d4100ee6
--- /dev/null
+++ b/Server/src/ProblemCard.java
@@ -0,0 +1,10 @@
+public class ProblemCard extends Card {
+
+ public ProblemCard(String cardText){
+ this.setCardText(cardText);
+ }
+
+ public String toString() {
+ return getCardText();
+ }
+}
diff --git a/Server/src/ProblemText.java b/Server/src/ProblemText.java
new file mode 100644
index 00000000..07ba01d6
--- /dev/null
+++ b/Server/src/ProblemText.java
@@ -0,0 +1,70 @@
+public enum ProblemText {
+ A("Maybe she's born with it, maybe it's ____."),
+ B("Old McDonald had a _____, Ia ia ohh"),
+ C("I'm going on a cleanse this week. Nothing but kale juice and ____."),
+ D("I got 99 problems but ____ ain't one."),
+ E("Hey guys, welcome to Chili's! Would you like to start the night off right with ____?"),
+ F("What will always get you laid?"),
+ G("A romantic, candlelit dinner would be incomplete without ____."),
+ H("White people like ____."),
+ I("What's that smell?"),
+ J("I get by with a little help from ____."),
+ K("Airport security guidelines now prohibit ____ on airplanes."),
+ L("The school trip was completely ruined by ____."),
+ M("Oi! Show us ____!"),
+ N("Science will never explain ____."),
+ O("During his midlife crisis, my dad got really into ____."),
+ P("Money can't buy me love, but it can buy me ____."),
+ Q("Future historians will agree that ____ marked the beginning of America's decline."),
+ R("When I am a billionaire, I shall erect a 20-meter statue to commemorate ____."),
+ S("When all else fails, I can always masturbate to ____."),
+ T("My plan for world domination begins with ____."),
+ U("What left this stain on my couch?"),
+ V("Introducing X-treme Baseball! It's like baseball, but with ____!"),
+ W("Well if you'll excuse me, gentlemen, I have a date with ____."),
+ X("Just once I'd like to hear you say \"Thanks, Mom. Thanks for ____.\""),
+ Y("Click Here for ____!!!"),
+ Z("Just saw this upsetting video! Please retweet!! #stop ____"),
+ AA("In the new Disney Channel Original Movie, Hannah Montana struggles with ____ for the first time."),
+ AB("I'm not going to lie. I despise ____. There, I said it."),
+ AC("All classes today are canceled due to ____."),
+ AD("Excuse me, waiter. Could you take this back? This soup tastes like ____."),
+ AE("It's beginning to look a lot like ____."),
+ AF("____: Achievement unlocked."),
+ AG("My body, my voice! ____, my choice!"),
+ AH("Donald Trump's first act as president was to outlaw ____."),
+ AI("You can't wait forever. It's time to talk to your doctor about ____."),
+ AJ("What's wrong with these gorillas?"),
+ AK("You say tomato, I say ____."),
+ AL("America is hungry. America needs ____."),
+ AM("Nothing says \"I love you\" like ____."),
+ AN(""),
+ AO(""),
+ AP(""),
+ AQ(""),
+ AR(""),
+ AS(""),
+ AT(""),
+ AU(""),
+ AV(""),
+ AW(""),
+ AX(""),
+ AY(""),
+ AZ("");
+
+
+
+
+ private final String problemText;
+
+ //Constructor for the solutiontexts
+ private ProblemText(String problemText){
+ this.problemText = problemText;
+ }
+
+ //A method to acces the String for of the list and not the label
+ public String printProblemText(){
+ return problemText;
+ }
+
+}
diff --git a/Server/src/Server.java b/Server/src/Server.java
new file mode 100644
index 00000000..c729a7d0
--- /dev/null
+++ b/Server/src/Server.java
@@ -0,0 +1,48 @@
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Date;
+
+public class Server {
+ private static int port = 6969;
+
+ public static void main(String[] args) {
+
+
+
+ new Thread( () -> {
+ try {
+ ServerSocket serverSocket = new ServerSocket(port);
+ System.out.println("Server has started at:" + new Date() + '\n');
+
+ //Counts the numbers of clients
+ int numberOfClient = 0;
+
+ while(true){
+ Socket connectToCLient = serverSocket.accept();
+ numberOfClient++;
+
+ //Displays information about the connected clients
+ System.out.println("Client has connected at:" + new Date() + '\n');
+ System.out.println("Total number of client connected: " + numberOfClient + '\n');
+
+ new Thread(
+ new ServerRunnable(connectToCLient, "Multithreaded Server")
+ ).start();
+
+
+ }
+
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ }).start();
+
+ }
+
+}
diff --git a/Server/src/ServerRunnable.java b/Server/src/ServerRunnable.java
new file mode 100644
index 00000000..2eadf636
--- /dev/null
+++ b/Server/src/ServerRunnable.java
@@ -0,0 +1,51 @@
+import java.io.*;
+import java.net.Socket;
+import java.util.ArrayList;
+import java.util.Date;
+
+public class ServerRunnable implements Runnable{
+ private Socket clientSocket = null;
+ private String serverText = "";
+
+ //Constructor for the class
+ public ServerRunnable(Socket clientSocket, String serverText){
+ this.clientSocket = clientSocket;
+ this.serverText = serverText;
+ }
+
+ @Override
+ public void run() {
+ try{
+ //System.out.println("A client has been connected at:" + new Date() + '\n');
+ boolean connected = true;
+
+ DataInputStream dataFromUser = new DataInputStream(clientSocket.getInputStream());
+ DataOutputStream dataToUser = new DataOutputStream(clientSocket.getOutputStream());
+
+
+ while(connected){
+
+
+ /*//Stuff happens here that makes the program work
+ ArrayList gameList = new ArrayList<>();
+
+ boolean gameCreated = false;
+ gameCreated = dataFromUser.readBoolean();
+
+ if(gameCreated = true){
+ gameList.add(new Game(dataFromUser.readUTF()));
+
+ //Sends the gameNames created back to the user
+ for (int i = 0; i < gameList.size(); i++){
+ dataToUser.writeUTF(gameList.get(i).getGameName());
+ }
+
+ }*/
+
+ }
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/Server/src/SolutionCard.java b/Server/src/SolutionCard.java
new file mode 100644
index 00000000..18391b08
--- /dev/null
+++ b/Server/src/SolutionCard.java
@@ -0,0 +1,10 @@
+public class SolutionCard extends Card {
+
+ public SolutionCard(String cardText){
+ this.setCardText(cardText);
+ }
+
+ public String toString(){
+ return getCardText();
+ }
+}
diff --git a/Server/src/SolutionText.java b/Server/src/SolutionText.java
new file mode 100644
index 00000000..577ba705
--- /dev/null
+++ b/Server/src/SolutionText.java
@@ -0,0 +1,97 @@
+//A class to handle the text fields for the solution cards
+public enum SolutionText {
+ A("Whole pack of jellybeans up my arse"),
+ B("A poopoo"),
+ C("Midgets riding a donkey"),
+ D("Eating horse poop"),
+ E("Mad cuz bad"),
+ F("Donald Trump"),
+ G("Dead parents"),
+ H("People who like James Corden"),
+ I("A donkey"),
+ J("The crippling fear that a duck is watching you"),
+ K("The finale of Game of Thrones"),
+ L("Walt Disneys frozen head"),
+ M("A raccoon in the trash"),
+ N("Goat milk"),
+ O("A dominatrix"),
+ P("Semen"),
+ Q("Porn addiction"),
+ R("Bees?"),
+ S("69 (nice)"),
+ T("Dancing queen"),
+ U("Big Time Rush"),
+ V("Magnum condoms"),
+ W("A crossword you can't solve"),
+ X("Mom calling during sex"),
+ Y("Saturday Night Live"),
+ Z("Pogo the Clown"),
+ AA("White people"),
+ AB("Black people"),
+ AC("Jennifer Lopez's booty"),
+ AD("The offside rule"),
+ AE("Karens"),
+ AF("Pickles in Koolaid"),
+ AG("Getting drunk with strangers"),
+ AH("Having a deep conversation with a stranger"),
+ AI("Poseidon's kiss"),
+ AJ("The Greek Pantheon"),
+ AK("Getting kicked so hard in the nuts, you lose your sense of vison"),
+ AL("Communism"),
+ AM("Proud nerds"),
+ AN("Regretting a tattoo"),
+ AO("Medialogy"),
+ AP("K-pop"),
+ AQ("Psychotic murder spree"),
+ AR("My celebrity crush"),
+ AS("Getting horny by 2D chicks"),
+ AT("The second coming of Christ"),
+ AU("Farting and a little bit of poop comes out"),
+ AV("The casting couch"),
+ AW("The complete Friends box-set"),
+ AX("Niel Patrick Harris"),
+ AY("An Oedipus complex"),
+ AZ("Beastiality"),
+ AAA("IM BATMAN!"),
+ AAB("Jeff Bezos penis rocket"),
+ AAC("Diversity"),
+ AAD("Asians"),
+ AAE("Pamela Anderson's... assets"),
+ AAF("The Nirvana baby"),
+ AAG("Michelle Obama"),
+ AAH("Killing it on the dancefloor"),
+ AAI("Seeing babies being electrocuted"),
+ AAJ("Being born"),
+ AAK("Buttsex"),
+ AAL("The moon landing"),
+ AAM("Having a colonoscopy"),
+ AAN("Sitting on the toilet and regretting the chili from the night before"),
+ AAO("Omegle"),
+ AAP("A horny elk"),
+ AAQ("Movie theaters"),
+ AAR("Cheese?"),
+ AAS("360 no scope"),
+ AAT("Blood"),
+ AAU("Cookies"),
+ AAV("Mimes"),
+ AAW("Pokemon being real"),
+ AAX("Getting stabbed"),
+ AAY("HELP!"),
+ AAZ("The idea that killing someone annoying should be ok");
+
+
+
+
+ private final String solutionText;
+
+ //Constructor for the solutiontexts
+ private SolutionText(String solutionText){
+ this.solutionText = solutionText;
+ }
+
+ //A method to acces the String for of the list and not the label
+ public String printSolutionText(){
+ return solutionText;
+ }
+
+}