diff --git a/Answers/How to send.txt b/40230112057/How to send.txt similarity index 100% rename from Answers/How to send.txt rename to 40230112057/How to send.txt diff --git a/40230112057/src/example/Beater.java b/40230112057/src/example/Beater.java new file mode 100644 index 0000000..6a079c7 --- /dev/null +++ b/40230112057/src/example/Beater.java @@ -0,0 +1,10 @@ +package example; + +public class Beater extends Player implements Success{ + + private int chance=40; + @Override + public boolean isSuccessful() { + return random.getrand()<=chance; + } +} diff --git a/40230112057/src/example/Chaser.java b/40230112057/src/example/Chaser.java new file mode 100644 index 0000000..b4a1135 --- /dev/null +++ b/40230112057/src/example/Chaser.java @@ -0,0 +1,12 @@ +package example; + +public class Chaser extends Player implements Success{ + private int chance=30; + + @Override + public boolean isSuccessful() { + return random.getrand()<=chance; + } + +} +//sdaadasdasd \ No newline at end of file diff --git a/40230112057/src/example/Keeper.java b/40230112057/src/example/Keeper.java new file mode 100644 index 0000000..4c0e7ad --- /dev/null +++ b/40230112057/src/example/Keeper.java @@ -0,0 +1,14 @@ +package example; + +public class Keeper extends Player implements Success{ + + private int chance=70; + @Override + public boolean isSuccessful() { + return random.getrand()<=chance; + } + public Keeper(String name,String number){ + super.name=name; + super.number=number; + } +} diff --git a/40230112057/src/example/Match.java b/40230112057/src/example/Match.java new file mode 100644 index 0000000..b5f63ef --- /dev/null +++ b/40230112057/src/example/Match.java @@ -0,0 +1,94 @@ +package example; + +public class Match { + Team team1; + Team team2=new Team(); + public void Start1(){ + if(team1.seeker.isSuccessful()){ + System.out.println("**************************************"); + System.out.println("team 1 won by finding the golden snitch."); + System.out.println("**************************************"); + System.out.println("The Scores:"); + + System.out.println("team1: "+(team1.goals+150)+" team2: "+team2.goals); + System.out.println("**************************************"); + return; + } + + if(team2.seeker.isSuccessful()){ + System.out.println("**************************************"); + System.out.println("team 2 won by finding the golden snitch."); + System.out.println("**************************************"); + System.out.println("The Scores:"); + + System.out.println("team1: "+team1.goals+" team2: "+(team2.goals+150)); + System.out.println("**************************************"); + return; + + } + + for(int i=0;i<100;i++){ + team1.Play(); + team2.Play(); + } + if(team1.goals>team2.goals){ + System.out.println("**************************************"); + System.out.println("team 1 won by having more goals."); + System.out.println("**************************************"); + System.out.println("The Scores:"); + + System.out.println("team1: "+team1.goals+" team2: "+team2.goals); + System.out.println("**************************************"); + } + else if(team1.goals