-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/tecimovic/programming-school
- Loading branch information
Showing
5 changed files
with
386 additions
and
0 deletions.
There are no files selected for viewing
101 changes: 101 additions & 0 deletions
101
src/main/java/programming/school/student/dylan/eggco/chicken.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
package programming.school.student.dylan.eggco; | ||
|
||
import java.util.Random; | ||
|
||
public class chicken { | ||
private String name; | ||
private int requiredSeedsPerDay; | ||
private int requiredCupsofWater; | ||
private int eggsPerDay; | ||
private int ageinDays; | ||
private int chickenhappiness; | ||
private final int crazynumber; | ||
private final int racistnumber; | ||
private boolean isdead; | ||
private final boolean isenlightened; | ||
private final boolean isgay; | ||
private boolean ismarried; | ||
private Gender gender; | ||
private Illness illness; | ||
private final Color color; | ||
enum Gender {boy,girl,nonbinary,ultimategender} | ||
enum Color {white, beige, black, gray, brown, waffled} | ||
enum Illness {sick, plagued, suffering, ultimatumillness, healthy} | ||
|
||
public chicken () { | ||
Random rnd = new Random(); | ||
this.ageinDays = 0; | ||
this.color = Color.values()[rnd.nextInt(Color.values().length)]; | ||
this.crazynumber = 0; | ||
this.racistnumber = 0; | ||
this.isenlightened = (rnd.nextInt(500) == 0); | ||
this.isgay = (rnd.nextInt(30) == 0); | ||
this.name = namingoffice.cname(); | ||
|
||
this.requiredSeedsPerDay = 10; | ||
this.requiredCupsofWater = 4; | ||
this.eggsPerDay = 3; | ||
this.ageinDays = 0; | ||
this.chickenhappiness = 10; | ||
this.isdead = false; | ||
int rndgender = rnd.nextInt(500); | ||
if (rndgender < 1) { | ||
this.gender = Gender.ultimategender; | ||
} else if (rndgender < 4) { | ||
this.gender = Gender.nonbinary; | ||
} else if (rndgender < 251) { | ||
this.gender = Gender.boy; | ||
} else { | ||
this.gender = Gender.girl; | ||
} | ||
int randosick = rnd.nextInt(10000); | ||
if (randosick < 1) { | ||
this.illness = Illness.ultimatumillness; | ||
} | ||
else if (randosick < 11) { | ||
this.illness = Illness.suffering; | ||
} | ||
else if (randosick < 31) { | ||
this.illness = Illness.plagued; | ||
} else if (randosick < 131) { // 131 | ||
this.illness = Illness.sick; | ||
} else { | ||
this.illness = Illness.healthy; | ||
} | ||
if (isenlightened == true) { | ||
this.gender = Gender.ultimategender; | ||
} | ||
} | ||
|
||
public void print () { | ||
System.out.println("KFC'S NEWEST INVENTION: KNOW YOUR MEAL! LEARN ACCURATE INFORMATION ON THE FINGER LICKIN' GOOD CHICKEN YOU ARE EATING RIGHT NOW!"); | ||
System.out.println("NAME:" + this.name); | ||
System.out.println("COLOR:" + color); | ||
System.out.println("GENDER:" + gender); | ||
if (isgay) { | ||
System.out.println("GAY: YES"); | ||
} | ||
else { | ||
System.out.println("GAY: NO"); | ||
} | ||
if (isenlightened) { | ||
System.out.println("ENLIGHTENED: YES"); | ||
} | ||
else { | ||
System.out.println("ENLIGHTENED: NO"); | ||
} | ||
} | ||
public void quikprintpng () { | ||
System.out.println("KFC'S KNOW YOUR MEAL! (TM) | NAME: " + this.name + " | COLOR: " + color + " | GENDER: " + gender + " | HEALTH: " + illness + " | GAY? " + (isgay? "YES" : "NO") + " | ENLIGHTENED? " + (isenlightened? "YES" : "NO")); | ||
} | ||
|
||
public boolean isgay() { | ||
return isgay; | ||
} | ||
public boolean issick() { | ||
return illness == Illness.sick; | ||
} | ||
public boolean isplagued() { | ||
return illness == Illness.plagued; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/programming/school/student/dylan/eggco/coop.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package programming.school.student.dylan.eggco; | ||
|
||
public class coop { | ||
private chicken[] ch; | ||
private String coopname; | ||
|
||
|
||
public coop(String coopname, int chigginnumber) { | ||
this.ch = new chicken[chigginnumber]; | ||
this.coopname = coopname; | ||
for(int b=0; b<ch.length; b++) { | ||
ch[b] = new chicken(); | ||
} | ||
} | ||
public void printpolyphemus () { | ||
System.out.println("The chiggins inside of coop " + coopname + " | rezeedents: " + ch.length); | ||
for (chicken c:ch) { | ||
c.quikprintpng(); | ||
} | ||
printodysseus(); | ||
} | ||
public void printodysseus () { | ||
int totalgay=0; | ||
for (chicken c : ch) { | ||
if (c.isgay()) { | ||
totalgay ++; | ||
} | ||
} | ||
int totalsick=0; | ||
for (chicken c : ch) { | ||
if(c.issick()) { | ||
totalsick ++; | ||
} | ||
} | ||
int totalplagued=0; | ||
boolean plaguedboolean; | ||
for (chicken c : ch) { | ||
if (c.isplagued()) { | ||
totalplagued ++; | ||
} | ||
} | ||
if (totalplagued > 0) { | ||
plaguedboolean = true; | ||
} else { | ||
plaguedboolean = false; | ||
} | ||
|
||
System.out.println("gay chiggins in coop: " + totalgay + " | sick chiggins in coop: " + totalsick + " | isths' coop plagued? " + plaguedboolean); | ||
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/programming/school/student/dylan/eggco/farm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package programming.school.student.dylan.eggco; | ||
|
||
public class farm { | ||
private coop[] coops = new coop[4]; | ||
public static void main(String[] args) { | ||
System.out.println("WELCOME TO GIDDY GIDEYOE'S RABBIDY CHIGGIN FARM! GUH GUH GUH!"); | ||
System.out.println("GIDDY GIDEYOE: HELLO PAR'NER! I AM GOING ON A VAY-CAYSHUN, ANAH NEED YOU TO MANAG' MAH CHIGGIN VARM! YUPEE!"); | ||
farm f = new farm(); | ||
f.ah_ah_ha(); | ||
} | ||
public farm () { | ||
for (int i=0; i<coops.length; i++) { | ||
if (i == 0) { | ||
coops[i] = new coop("thu kingly palas", 1); | ||
} | ||
else if (i == 1) { | ||
coops[i] = new coop("manshn hills", 10); | ||
} | ||
else if (i == 2) { | ||
coops [i] = new coop("hull masachewsets", 20); | ||
} | ||
else if (i == 3) { | ||
coops [i] = new coop("thu suuper puuper", 30); | ||
} | ||
} | ||
} | ||
public void ah_ah_ha () { | ||
for (coop d:coops) { | ||
d.printpolyphemus(); | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/programming/school/student/dylan/eggco/namingoffice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package programming.school.student.dylan.eggco; | ||
|
||
import java.util.Random; | ||
|
||
public class namingoffice { | ||
public static String[] chigginname = new String[]{"Dylan", "Julia", "Timotejrar", "Bob", "Bart", "Bag", "Factorysong", "Aaaaaiamasteve", "Dumbone", "Dummerone", "Verystupid", "KFC", "Thatone", "Fiona", "Olivia", "Stella", "Ashlyn", "Amayah", "Victoria", "Cosietan", "Couscous", "Charcoal", "Nutmeg", "Fluffy", "Hoodsie", "Cinnamon", "Soil", "Notgay", "Bidet", "Timotejisstaringathisphone", "Kazakhstan", "Astrangesymbolifyouwant", "The", "Velvet", "Underground", "Gerald", "Hart", "Wart", "Cloud", "Whisperers", "Rush", "Ambush", "Seek", "Figure", "Skibidi", "Loureed", "Trump", "Biden", "Commonwealthsuks"}; | ||
public static String cname() { | ||
Random rando = new Random(); | ||
return chigginname[rando.nextInt(chigginname.length)]; | ||
} | ||
} |
191 changes: 191 additions & 0 deletions
191
src/main/java/programming/school/student/dylan/publicstaticfirst.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
package programming.school.student.dylan; | ||
|
||
import java.util.Arrays; | ||
import java.util.Random; | ||
|
||
public class publicstaticfirst { | ||
private static double mbta_drail(double x, double y) { | ||
return x/y; | ||
} | ||
public static void main(String[]args) { | ||
System.out.println("ohdysseus"); | ||
System.out.println("this is how strongeus! he e e i i is!:" +mbta_drail(2,7)); | ||
System.out.println("True of false! I ain't telling you !" + isNegative (987)); | ||
System.out.println("Say this dadd day" + sign(10)); | ||
System.out.println("Say this dadd day" + sign(5)); | ||
System.out.println("Say this dadd day" + sign(0)); | ||
System.out.println("Say this dadd day" + sign(-5)); | ||
System.out.println("Say this dadd day" + sign(-50)); | ||
System.out.println("Say this dadd day" + sign(42)); | ||
|
||
flopsy(999); | ||
dicethrowgee(43); | ||
|
||
areYouDead(3); | ||
areYouDead(9); | ||
areYouDead(42); | ||
|
||
explode_others(0, 10, 7); | ||
explode_others(3, 4, 10); | ||
explode_others(5, 4, 8); | ||
explode_others(-6, 12, 5); | ||
|
||
explode_others(20000, 20000, 2); | ||
|
||
bouyilstunn(); | ||
callmecallme(); | ||
polyphemus(); | ||
thedylanspecial(); | ||
} | ||
public static boolean isNegative(double n) { | ||
|
||
if (n < 0) { | ||
System.out.println("True or false !? I ain't telling you!"); | ||
return true; | ||
|
||
} else { | ||
System.out.println("True or false!? I ain't telling you!"); | ||
return false; | ||
} | ||
} | ||
|
||
public static String sign(int n) { | ||
if (n>0 && n<10) { | ||
return "small summfink"; | ||
}else if(n>41 && n<43) { return "the life and universe summfink or other"; | ||
} else if(n<0 && n>-10) { | ||
return "taking my bites away"; | ||
} else if(n>9) { return "big summfink"; | ||
} else if(n<-9) { return "taking my meals away"; | ||
} else { | ||
return "nuffink"; | ||
} | ||
|
||
} | ||
public static void flopsy(int n) { | ||
int x=0; | ||
while (x<n) { | ||
System.out.println("the larch"); | ||
x++; | ||
} | ||
} | ||
public static void dicethrowgee(int target) { | ||
int singasongoffilch; | ||
Random filch = new Random(); | ||
while ((singasongoffilch = filch.nextInt(12)) > 1) { | ||
System.out.println(singasongoffilch); | ||
} | ||
System.out.println(filch); | ||
} | ||
|
||
public static void areYouDead(int x) { | ||
if (x % 2 == 1) { | ||
System.out.println("sometoimes oi think oim ded. coz oi can feel gostsangools rapping moi hed"); | ||
} else { | ||
System.out.println("oi dont think oim ded, thank yoi veree moich."); | ||
} | ||
} | ||
|
||
public static boolean explode_others(int red, int blue, int orange) { | ||
if (red < 0 || blue < 0){ | ||
System.out.println("We're sorry, due to our allience with Citizen's Bank (MAKING BANKING BETTER SINCE 1828 (TM)), we must cancel your charliecard purchasing due to you being in debt. Please buy a charliecard in our debt-only store in Roxbury. Thank you for your patronage, which to Citizen's Bank is false."); | ||
return false; | ||
} | ||
if (red + blue >= orange) { | ||
System.out.println("you can buy " + ((red + blue) / orange) + " charliecards. the mbta thanks you for your patronage, which is true."); | ||
return true; | ||
} else { | ||
System.out.println("please insert " + (orange - (red + blue)) + " more dollars to purchase a charliecard, unfortunately your charliecard-purchasing ability is false."); | ||
return false; | ||
} | ||
} | ||
public static void bouyilstunn() { | ||
int dollarsanddays = 0; | ||
for (int x=0; x<=100; x++) { | ||
System.out.println("The MBTA pays you " + x + " dollars"); | ||
for (int y=0; y<=100; y++) { | ||
System.out.println("YOU WAIT FOR " + y + " DAYS TO MAKE IT TO YOUR PROMOTION"); | ||
dollarsanddays += x; | ||
dollarsanddays += y; | ||
} | ||
} | ||
System.out.println("Dollars & Days variable: " + dollarsanddays); | ||
|
||
} | ||
public static void callmecallme() { | ||
for (int unmannerliness=0; unmannerliness<=1000; unmannerliness++) { | ||
System.out.print(unmannerliness + " "); | ||
if(unmannerliness % 100 == 0) { | ||
System.out.println("dat got da jakpot oh ya ayyayya ya ya ya FWEW FEWE FWEW FWEW OHHHHHHHH OHHHHHHHHHH DIVISIB-LE! MEGA DIVISIB-LE!!!!!! SUPER MEGA EXTREME DIVISIB-LE! FWEW FWEW FWWE"); | ||
} | ||
else | ||
if(unmannerliness % 10 == 0) { | ||
System.out.println("dat was a lukke one DIVISIB-LE! GOOD DIVISIB-LE! WHOOOOOOOOOO! GOOD JOB!"); | ||
} | ||
else | ||
if(unmannerliness % 2 == 0) { | ||
System.out.println("Divisib-le! Lucky!"); | ||
} | ||
else { | ||
System.out.println("Unlucky Not Divisib-le. wahh wahhh wahhhhh."); | ||
} | ||
} | ||
} | ||
public static void polyphemus() { | ||
Random randoguyaresafe = new Random(); | ||
int[] reando = new int[100]; | ||
for (int i=0; i<reando.length; i++) { | ||
reando[i] = randoguyaresafe.nextInt(1000); | ||
} | ||
System.out.println("odysseus and the randoguys are in a cave odysseus and the randoguys are safe sheep meat sheep meat it didnt even make a bleat and it was dead odysseus thought he was safe it was like the sheep were laid out for him for him to come and take sheep meat is nice shelter is nice but ill tell you what isnt nice maybe though not now"); | ||
randoguy12(reando); | ||
} | ||
public static void thedylanspecial() { | ||
System.out.println("And now, the filter!"); | ||
Random velvetunderground = new Random(); | ||
int[] ronweasley = new int[5]; | ||
int[] hermionegranger = new int[5]; | ||
for (int koolstoof = 0; koolstoof<ronweasley.length; koolstoof++) { | ||
ronweasley[koolstoof] = velvetunderground.nextInt(1000); | ||
} | ||
for (int ronsponsibility = 0; ronsponsibility<hermionegranger.length; ronsponsibility++) { | ||
hermionegranger[ronsponsibility] = velvetunderground.nextInt(1000); | ||
} | ||
randoguy12(ronweasley); | ||
randoguy12(hermionegranger); | ||
System.out.println("That was a wonderful filter, folks! But now... The apple!"); | ||
int[] hairybutter = new int[10]; | ||
for(int sansbattle = 0; sansbattle<ronweasley.length; sansbattle++) { | ||
hairybutter[sansbattle] = ronweasley[sansbattle]; | ||
} | ||
for(int sansbattle = 0; sansbattle<hermionegranger.length; sansbattle++) { | ||
hairybutter[sansbattle + 5] = hermionegranger[sansbattle]; | ||
} | ||
randoguy12(hairybutter); | ||
System.out.println(smallest(hairybutter)); | ||
System.out.println(smallest(ronweasley)); | ||
System.out.println(smallest(hermionegranger)); | ||
System.out.println("And now: the sorting hat!"); | ||
Arrays.sort(hairybutter); | ||
Arrays.sort(ronweasley); | ||
Arrays.sort(hermionegranger); | ||
randoguy12(hairybutter); | ||
randoguy12(ronweasley); | ||
randoguy12(hermionegranger); | ||
} | ||
public static int smallest(int[] myeh) { | ||
System.out.println("MYEH COLLECTING CO COLLECTED THIS:"); | ||
int babymyeh = myeh[0]; | ||
for(int myehcollector = 0; myehcollector<myeh.length; myehcollector++) { | ||
if (myeh[myehcollector] < babymyeh) { | ||
babymyeh = myeh[myehcollector]; | ||
} | ||
} | ||
return babymyeh; | ||
} | ||
public static void randoguy12(int[] hairy) { | ||
for (int i=0; i<hairy.length; i++) { | ||
System.out.println(hairy[i]); | ||
} | ||
} | ||
} |