diff --git a/Answers/40230112050/Beater.java b/Answers/40230112050/Beater.java
new file mode 100644
index 0000000..a469486
--- /dev/null
+++ b/Answers/40230112050/Beater.java
@@ -0,0 +1,22 @@
+import java.util.Random;
+
+public class Beater extends Player implements Success {
+ @Override
+ public boolean isSuccessful() {
+
+ boolean status =false ;
+
+ int randnumber ;
+
+ Random rand = new Random();
+ randnumber = rand.nextInt(100)+1;
+
+ if (randnumber<=30)
+ status = true ;
+
+
+ return status;
+
+
+ }
+}
diff --git a/Answers/40230112050/Chaser.java b/Answers/40230112050/Chaser.java
new file mode 100644
index 0000000..b04cc18
--- /dev/null
+++ b/Answers/40230112050/Chaser.java
@@ -0,0 +1,21 @@
+import java.util.Random;
+
+public class Chaser extends Player implements Success{
+ @Override
+ public boolean isSuccessful() {
+
+ boolean status =false ;
+
+ int randnumber ;
+
+ Random rand = new Random();
+ randnumber = rand.nextInt(100)+1;
+
+ if (randnumber<=40)
+ status = true ;
+
+
+ return status;
+
+ }
+}
diff --git a/Answers/40230112050/Keeper.java b/Answers/40230112050/Keeper.java
new file mode 100644
index 0000000..3376893
--- /dev/null
+++ b/Answers/40230112050/Keeper.java
@@ -0,0 +1,20 @@
+import java.util.Random;
+
+public class Keeper extends Player implements Success{
+ @Override
+ public boolean isSuccessful() {
+
+ boolean status =false ;
+
+ int randnumber ;
+
+ Random rand = new Random();
+ randnumber = rand.nextInt(100)+1;
+
+ if (randnumber<=70)
+ status = true ;
+
+
+ return status;
+ }
+}
diff --git a/Answers/40230112050/Main.java b/Answers/40230112050/Main.java
new file mode 100644
index 0000000..1a2cafe
--- /dev/null
+++ b/Answers/40230112050/Main.java
@@ -0,0 +1,8 @@
+//TIP To Run code, press or
+// click the icon in the gutte
+public class Main {
+ public static void main(String[] args) {
+ MyApp myapp = new MyApp();
+ myapp.str();
+ }
+}
diff --git a/Answers/40230112050/Match.java b/Answers/40230112050/Match.java
new file mode 100644
index 0000000..ef6f8be
--- /dev/null
+++ b/Answers/40230112050/Match.java
@@ -0,0 +1,14 @@
+import java.util.Objects;
+
+public class Match {
+
+ public void start(String n) {
+ if(Objects.equals(n, "start")){
+ Team team = new Team();
+ team.Play();
+ }
+
+
+
+ }
+}
diff --git a/Answers/40230112050/MyApp.java b/Answers/40230112050/MyApp.java
new file mode 100644
index 0000000..812f191
--- /dev/null
+++ b/Answers/40230112050/MyApp.java
@@ -0,0 +1,12 @@
+import java.util.Scanner;
+
+public class MyApp {
+ public void str() {
+ System.out.println("please type start:");
+ Scanner input = new Scanner(System.in);
+ String n = input.nextLine();
+ Match match = new Match();
+ match.start(n);
+
+ }
+}
diff --git a/Answers/40230112050/Player.java b/Answers/40230112050/Player.java
new file mode 100644
index 0000000..ce88495
--- /dev/null
+++ b/Answers/40230112050/Player.java
@@ -0,0 +1,2 @@
+public class Player {
+}
diff --git a/Answers/40230112050/Seeker.java b/Answers/40230112050/Seeker.java
new file mode 100644
index 0000000..b1ca4f7
--- /dev/null
+++ b/Answers/40230112050/Seeker.java
@@ -0,0 +1,21 @@
+import java.util.Random;
+
+public class Seeker extends Player implements Success{
+ @Override
+ public boolean isSuccessful() {
+
+ boolean status =false ;
+
+ int randnumber ;
+
+ Random rand = new Random();
+ randnumber = rand.nextInt(100)+1;
+
+ if (randnumber<=5)
+ status = true ;
+
+
+ return status;
+
+ }
+}
diff --git a/Answers/40230112050/Success.java b/Answers/40230112050/Success.java
new file mode 100644
index 0000000..bc0bcf2
--- /dev/null
+++ b/Answers/40230112050/Success.java
@@ -0,0 +1,3 @@
+public interface Success {
+ boolean isSuccessful();
+}
diff --git a/Answers/40230112050/Team.java b/Answers/40230112050/Team.java
new file mode 100644
index 0000000..aeed1e3
--- /dev/null
+++ b/Answers/40230112050/Team.java
@@ -0,0 +1,102 @@
+import com.sun.security.jgss.GSSUtil;
+
+public class Team {
+ int s = 0 ;
+
+ Chaser chaser11 = new Chaser();
+ Chaser chaser12 = new Chaser();
+ Chaser chaser13 = new Chaser();
+ Chaser chaser21 = new Chaser();
+ Chaser chaser22 = new Chaser();
+ Chaser chaser23 = new Chaser();
+ Beater beater11 = new Beater();
+ Beater beater12 = new Beater();
+ Beater beater21 = new Beater();
+ Beater beater22 = new Beater();
+ Seeker seeker1 = new Seeker();
+ Seeker seeker2 = new Seeker();
+ Keeper keeper1 = new Keeper();
+ Keeper keeper2 = new Keeper();
+
+ int goal1 = 0;
+ int goal2 = 0;
+
+ public void Play() {
+ for(int i = 0 ; i < 100 ; i++) {
+ Team1();
+ Team2();
+ if (seeker1.isSuccessful()){
+ System.out.println("team1 found gold snitch!!!!!");
+ System.out.println("team1 won");
+ s = 1;
+ break;
+ }
+ if (seeker2.isSuccessful()){
+ System.out.println("team2 found gold snitch!!!!!");
+ System.out.println("team2 won");
+ s = 1;
+ break;
+ }
+ }
+ if(s != 1) {
+ System.out.format("team1 score:%d \nteam2 score:%d\n", getGoal1(goal1), getGoal2(goal2));
+ if (getGoal1(goal1) > getGoal2(goal2)) {
+ System.out.println("\nTeam1 won!!");
+
+ } else if (getGoal1(goal1) < getGoal2(goal2)) {
+ System.out.println("\nTeam2 won!!");
+
+ } else {
+ System.out.println("\nDraw");
+ }
+ }
+
+
+ }
+
+
+
+ public void Team1 () {
+ if (keeper1.isSuccessful()) {
+ if (beater11.isSuccessful() || beater12.isSuccessful()) {
+ if ((chaser11.isSuccessful() && chaser12.isSuccessful()) || (chaser11.isSuccessful() && chaser13.isSuccessful()) || (chaser12.isSuccessful() && chaser13.isSuccessful())) {
+ setgoal1();
+ }
+ }
+ }
+
+
+
+ }
+
+ private void setgoal1 () {
+ goal1++;
+
+ }
+ public int getGoal1(int goal1){
+ return goal1;
+ }
+
+ public void Team2 (){
+ if (keeper2.isSuccessful()) {
+ if (beater21.isSuccessful() || beater22.isSuccessful()) {
+ if ((chaser21.isSuccessful() && chaser22.isSuccessful()) || (chaser21.isSuccessful() && chaser23.isSuccessful()) || (chaser22.isSuccessful() && chaser23.isSuccessful())) {
+ setgoal2();
+ }
+ }
+ }
+
+
+ }
+ private void setgoal2 () {
+ goal2++;
+
+ }
+ public int getGoal2(int goal2){
+ return goal2;
+ }
+
+
+
+
+}
diff --git a/README.md b/README.md
index ea11fad..b6123d3 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# Quidditch
-In this assignment, we will delve into Object-Oriented Programming (OOP) with a simple but appealing mini project. This mini project would be very enjoyable for Harry Potter fans, but if you haven't watched the film, don't worry; you don't need any pre-knowledge about this film to do this assignment. You can also use [this link](https://gustavus.edu/im/Spring/quidditch-rules.php#:~:text=Neither%20seekers%20nor%20snitched%20are,their%20broomstick%20at%20all%20times.) to read about Quidditch rules.
+In this assignment, w[README.md](README.md)e will delve into Object-Oriented Programming (OOP) with a simple but appealing mini project. This mini project would be very enjoyable for Harry Potter fans, but if you haven't watched the film, don't worry; you don't need any pre-knowledge about this film to do this assignment. You can also use [this link](https://gustavus.edu/im/Spring/quidditch-rules.php#:~:text=Neither%20seekers%20nor%20snitched%20are,their%20broomstick%20at%20all%20times.) to read about Quidditch rules.
## What Should I Do
Your assignment is a bit different from the real game. You won't need to implement any GUI or complex logic; the whole logic will be handled by chance. Don't worry!
@@ -26,7 +26,7 @@ The beater has a 40% chance to stop chasers.
- Create an interface called `Success` and put the method `isSuccessful` inside it. Don't forget to implement this interface with all of your roles. What's next?
#### Team
-- Create a class for `Team`. This class contains players of your team (1 Keeper, 1 Seeker, 3 Chasers, and 2 Beaters) and the number of goals, which is zero at the beginning of the game.
+- Create a class for `Team`. This class contains players of your team (1 Keeper, 1 Seeker, 3 Chasers, and 2 Beater) and the number of goals, which is zero at the beginning of the game.
- It has a method called `setGoal`, and after calling it, the number of goals increases by one. However, this method is private.
- Also, we have another method called `play`. After calling this method, the team will start playing the game, and if the conditions are met, then the `setGoal` method will be called.