-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Project exclude paths | ||
/out/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Main-Class: Main | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
public class Act { | ||
Dots d = new Dots(); | ||
void one(){ | ||
Everything everything = new Everything("Все"); | ||
|
||
|
||
System.out.println(everything+d.dot(DotsType.SPACE)+everything.look()+d.dot(DotsType.AND)+everything.turnBack()); | ||
} | ||
void two(){ | ||
Shadow shadow = new Shadow("тень"); | ||
shadow.addDescription("Какая-то"); | ||
|
||
Corner corner = new Corner("углу"); | ||
corner.addDescription("темном"); | ||
|
||
Wall wall = new Wall("стена", corner.getDescription(0)+d.dot(DotsType.SPACE)+corner); | ||
|
||
|
||
System.out.println(shadow.getDescription(0)+d.dot(DotsType.SPACE)+shadow+d.dot(DotsType.SPACE)+shadow.separate(wall.whereIs())); | ||
} | ||
void three(){ | ||
Something something = new Something("Что-то"); | ||
something.addDescription("серое"); | ||
something.addDescription("сморщенное"); | ||
Floor floor = new Floor("пол", "гостинной"); | ||
|
||
Light light = new Light("света"); | ||
light.addDescription("солнечого"); | ||
|
||
Mustache mustache = new Mustache("усами"); | ||
mustache.addDescription("седыми"); | ||
|
||
Family family = new Family("семью муми-троллей"); | ||
|
||
|
||
System.out.println(something+d.dot(DotsType.SPACE)+something.getDescription(0)+d.dot(DotsType.AND)+something.getDescription(1) | ||
+d.dot(DotsType.SPACE)+something.shuffled(floor+d.dot(DotsType.SPACE)+floor.whereIs())+d.dot(DotsType.COMMA) | ||
+something.blinked(light.getDescription(0)+d.dot(DotsType.SPACE)+light)+d.dot(DotsType.AND) | ||
+something.shake(mustache.getDescription(0)+d.dot(DotsType.SPACE)+mustache)+d.dot(DotsType.COMMA) | ||
+something.look(family.toString())+d.dot(DotsType.DOT)); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import java.util.ArrayList; | ||
|
||
public class Corner extends Thing { | ||
|
||
public Corner(String name) { | ||
super(name); | ||
} | ||
|
||
public Corner(String name, ArrayList<String> des) { | ||
super(name, des); | ||
} | ||
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
public class Dots { | ||
public String dot(DotsType dt){ | ||
if (dt == DotsType.SPACE){return " ";} | ||
if (dt == DotsType.AND){return " и ";} | ||
if (dt == DotsType.COMMA){return ", ";} | ||
if (dt == DotsType.DOT){return ".";} | ||
else return "null"; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public enum DotsType { | ||
SPACE, | ||
COMMA, | ||
DOT, | ||
AND | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
public class Everything extends Thing { | ||
Everything(String name){ | ||
super(name); | ||
|
||
} | ||
String look(){ | ||
return "посмотрели"; | ||
} | ||
String turnBack(){ | ||
return "обернулись"; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import java.util.ArrayList; | ||
|
||
public class Family extends Thing { | ||
public Family(String name) { | ||
super(name); | ||
} | ||
|
||
public Family(String name, ArrayList<String> des) { | ||
super(name, des); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
public class Floor extends Place { | ||
public Floor(String name) { | ||
super(name); | ||
} | ||
|
||
public Floor(String name, String whereIs) { | ||
super(name, whereIs); | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public interface IPlace { | ||
String getName(); | ||
String whereIs(); | ||
|
||
String toString(); | ||
boolean equals(Object obj); | ||
int hashCode(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
public interface IThing { | ||
String getName(); | ||
String getDescription(int i); | ||
|
||
String toString(); | ||
boolean equals(Object pbj); | ||
int hashCode(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
public class Light extends Thing { | ||
public Light(String name) { | ||
super(name); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
public class Main { | ||
/* | ||
Все обернулись и посмотрели. Какая-то тень отделилась от стены в темном углу. | ||
Что-то серое и сморщенное прошаркало по полу гостиной, заморгало от солнечного света и затрясло седыми усами, | ||
враждебно оглядывая семью муми-троллей. | ||
*/ | ||
public static void main(String[] args) { | ||
|
||
/*Everything everything = new Everything("Все"); | ||
Shadow shadow = new Shadow("тень"); | ||
shadow.addDescription("Какая-то"); | ||
Corner corner = new Corner("углу"); | ||
corner.addDescription("темном"); | ||
Wall wall = new Wall("стена", corner.getDescription(0)+d.dot(DotsType.SPACE)+corner); | ||
Something something = new Something("Что-то"); | ||
something.addDescription("серое"); | ||
something.addDescription("сморщенное"); | ||
Floor floor = new Floor("пол", "гостинной"); | ||
Light light = new Light("света"); | ||
light.addDescription("солнечого"); | ||
Mustache mustache = new Mustache("усами"); | ||
mustache.addDescription("седыми"); | ||
Family family = new Family("семью муми-троллей"); | ||
Act act = new Act(); | ||
*/ | ||
/* | ||
System.out.println(everything+d.dot(DotsType.SPACE)+everything.look()+d.dot(DotsType.AND)+everything.turnBack()); | ||
System.out.println(shadow.getDescription(0)+d.dot(DotsType.SPACE)+shadow+d.dot(DotsType.SPACE)+shadow.separate(wall.whereIs())); | ||
System.out.println(something+d.dot(DotsType.SPACE)+something.getDescription(0)+d.dot(DotsType.AND)+something.getDescription(1) | ||
+d.dot(DotsType.SPACE)+something.shuffled(floor+d.dot(DotsType.SPACE)+floor.whereIs())+d.dot(DotsType.COMMA) | ||
+something.blinked(light.getDescription(0)+d.dot(DotsType.SPACE)+light)+d.dot(DotsType.AND) | ||
+something.shake(mustache.getDescription(0)+d.dot(DotsType.SPACE)+mustache)+d.dot(DotsType.COMMA) | ||
+something.look(family.toString())+d.dot(DotsType.DOT)); | ||
*/ | ||
Act act = new Act(); | ||
act.one(); | ||
act.two(); | ||
act.three(); | ||
} | ||
} |