From 43159a682b6710f8821fe5d0616807dcc200eb7d Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Mon, 7 Nov 2022 22:00:46 +0000 Subject: [PATCH 1/8] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C?= =?UTF-8?q?=20'MyFirstUniverse/game.c'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyFirstUniverse/game.c | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 MyFirstUniverse/game.c diff --git a/MyFirstUniverse/game.c b/MyFirstUniverse/game.c deleted file mode 100644 index 46131db..0000000 --- a/MyFirstUniverse/game.c +++ /dev/null @@ -1,5 +0,0 @@ -#include - -int main(){ - printf("Hello world"); -} From a357b0578f50eb4f1d0b1fc3b16adc5465f313be Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Mon, 7 Nov 2022 22:10:47 +0000 Subject: [PATCH 2/8] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'MyFirstUniverse/src/com/company/unive?= =?UTF-8?q?rse/Universe.java'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/company/universe/Universe.java | 79 ++++++++++--------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/MyFirstUniverse/src/com/company/universe/Universe.java b/MyFirstUniverse/src/com/company/universe/Universe.java index a90d873..290a7c0 100644 --- a/MyFirstUniverse/src/com/company/universe/Universe.java +++ b/MyFirstUniverse/src/com/company/universe/Universe.java @@ -1,39 +1,40 @@ -package com.company.universe; - -public class Universe { - private boolean state; - private long size; - - public Universe() { - state = false; - size = 0; - } - - public void startUniverse(){ - state = true; - System.out.println("World is ready\n"); - increaseSize(); - decreaseSize(10000); - } - - public void stopUniverse(){ - state = false; - System.out.println("\nWorld is stop"); - } - - private void increaseSize(){ - while (size<999000){ - size++; - //System.out.println("Wait. Universe " + size + "km3"); - } - System.out.println("Universe is " + size + "km3"); - } - - private void decreaseSize(long desiredSize){ - while (size > desiredSize){ - size--; - //System.out.println ("Wait. Compressed world " + size + "km3"); - } - System.out.println ("Compress world is " + size + "km3\n"); - } -} +package com.company.universe; + +public class Universe { + private boolean state; + private long size; + + public Universe() { + state = false; + size = 0; + startUniverse(); + } + + public void startUniverse(){ + state = true; + System.out.println("World is ready\n"); + increaseSize(); + decreaseSize(10000); + } + + public void stopUniverse(){ + state = false; + System.out.println("\nWorld is stop"); + } + + private void increaseSize(){ + while (size<999000){ + size++; + //System.out.println("Wait. Universe " + size + "km3"); + } + System.out.println("Universe is " + size + "km3"); + } + + private void decreaseSize(long desiredSize){ + while (size > desiredSize){ + size--; + //System.out.println ("Wait. Compressed world " + size + "km3"); + } + System.out.println ("Compress world is " + size + "km3\n"); + } +} From 8efe7417df08c55033eb64a3e621d3f4d731b109 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Mon, 7 Nov 2022 22:14:20 +0000 Subject: [PATCH 3/8] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'MyFirstUniverse/src/com/company/cosmi?= =?UTF-8?q?cbody/Planet.java'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/company/cosmicbody/Planet.java | 206 +++++++++--------- 1 file changed, 103 insertions(+), 103 deletions(-) diff --git a/MyFirstUniverse/src/com/company/cosmicbody/Planet.java b/MyFirstUniverse/src/com/company/cosmicbody/Planet.java index 12b70c4..8f82886 100644 --- a/MyFirstUniverse/src/com/company/cosmicbody/Planet.java +++ b/MyFirstUniverse/src/com/company/cosmicbody/Planet.java @@ -1,103 +1,103 @@ -package com.company.cosmicbody; - -public class Planet extends CosmicBody { - private String name; - private double weight; - private double diameter; - private double gravitation; - private Boolean weightSet = false; - - public void setPlanetaryWeight(double weight){ - if(!weightSet){ - setWeight(weight); - weightSet = true; - } - } - - - public double getWeight() { - return weight; - } - - private void setWeight(double weight) { - if(this.weight>weight){ - if(Math.abs(this.weight-weight) <= 1000){ - System.out.println("I'm losing weight."); - } - else { - System.out.println("I am very poor."); - } - } - else{ - if(Math.abs(this.weight-weight) <= 1000){ - System.out.println("Damn, I woke up."); - } - else { - System.out.println("Damn, I put on too much weight."); - } - } - - if(Math.abs(this.weight-weight)>1000){ - increaseGravity(0.1); - } else { - decreaseGravity(0.1); - } - - this.weight = weight; - } - - public double getDiameter() { - return diameter; - } - - private void setDiameter(double diameter) { - this.diameter = diameter; - } - - public String getName() { - return name; - } - - private void setName(String name) { - this.name = name; - } - - public double getGravitation() { - return gravitation; - } - - public void setGravitation(double gravitation) { - this.gravitation = gravitation; - } - - public Planet(String name, double weight, double diameter) { -// setWeight(weight); -// setDiameter(diameter); -// setName(name); - this.name = name; - this.weight = weight; - this.diameter = diameter; - this.gravitation = 9.81; - } - - private void increaseGravity(double add){ - gravitation = gravitation + add; - } - private void decreaseGravity(double dec){ - gravitation = gravitation - dec; - } - - public Planet(String name, double weight, double diameter, double gravitation) { - this.name = name; - this.weight = weight; - this.diameter = diameter; - this.gravitation = gravitation; - } - -// public Planet() { -// this.name = "Zem"; -// this.weight = 5972200; -// this.diameter = 12756; -// } - -} +package com.company.cosmicbody; + +public class Planet extends CosmicBody { + private String name; + private double weight; + private double diameter; + private double gravitation; + private Boolean weightSet = false; + + public void setPlanetaryWeight(double weight){ + if(!weightSet){ + setWeight(weight); + weightSet = true; + } + } + + + public double getWeight() { + return weight; + } + + private void setWeight(double weight) { + if(this.weight>weight){ + if(Math.abs(this.weight-weight) <= 1000){ + System.out.println("I'm losing weight."); + } + else { + System.out.println("I'm losing a lot of weight."); + } + } + else{ + if(Math.abs(this.weight-weight) <= 1000){ + System.out.println("Damn, I woke up."); + } + else { + System.out.println("Damn, I put on too much weight."); + } + } + + if(Math.abs(this.weight-weight)>1000){ + increaseGravity(0.1); + } else { + decreaseGravity(0.1); + } + + this.weight = weight; + } + + public double getDiameter() { + return diameter; + } + + private void setDiameter(double diameter) { + this.diameter = diameter; + } + + public String getName() { + return name; + } + + private void setName(String name) { + this.name = name; + } + + public double getGravitation() { + return gravitation; + } + + public void setGravitation(double gravitation) { + this.gravitation = gravitation; + } + + public Planet(String name, double weight, double diameter) { +// setWeight(weight); +// setDiameter(diameter); +// setName(name); + this.name = name; + this.weight = weight; + this.diameter = diameter; + this.gravitation = 9.81; + } + + private void increaseGravity(double add){ + gravitation = gravitation + add; + } + private void decreaseGravity(double dec){ + gravitation = gravitation - dec; + } + + public Planet(String name, double weight, double diameter, double gravitation) { + this.name = name; + this.weight = weight; + this.diameter = diameter; + this.gravitation = gravitation; + } + +// public Planet() { +// this.name = "Zem"; +// this.weight = 5972200; +// this.diameter = 12756; +// } + +} From 98217560dfadcf8f43d67c03e1972e14efc5c2c6 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Mon, 7 Nov 2022 22:19:10 +0000 Subject: [PATCH 4/8] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'MyFirstUniverse/src/com/company/cosmi?= =?UTF-8?q?cbody/Planet.java'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyFirstUniverse/src/com/company/cosmicbody/Planet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MyFirstUniverse/src/com/company/cosmicbody/Planet.java b/MyFirstUniverse/src/com/company/cosmicbody/Planet.java index 8f82886..2591ef9 100644 --- a/MyFirstUniverse/src/com/company/cosmicbody/Planet.java +++ b/MyFirstUniverse/src/com/company/cosmicbody/Planet.java @@ -19,7 +19,7 @@ public class Planet extends CosmicBody { return weight; } - private void setWeight(double weight) { + public void setWeight(double weight) { if(this.weight>weight){ if(Math.abs(this.weight-weight) <= 1000){ System.out.println("I'm losing weight."); @@ -37,7 +37,7 @@ public class Planet extends CosmicBody { } } - if(Math.abs(this.weight-weight)>1000){ + if(Math.abs(this.weight-weight) < 1000){ increaseGravity(0.1); } else { decreaseGravity(0.1); @@ -50,7 +50,7 @@ public class Planet extends CosmicBody { return diameter; } - private void setDiameter(double diameter) { + public void setDiameter(double diameter) { this.diameter = diameter; } @@ -58,7 +58,7 @@ public class Planet extends CosmicBody { return name; } - private void setName(String name) { + public void setName(String name) { this.name = name; } From f1eeacdf039a34086c927f34af920856dd80cd0a Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Mon, 7 Nov 2022 22:20:01 +0000 Subject: [PATCH 5/8] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'MyFirstUniverse/src/com/company/unive?= =?UTF-8?q?rse/PlanetaryNebula.java'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/company/universe/PlanetaryNebula.java | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/MyFirstUniverse/src/com/company/universe/PlanetaryNebula.java b/MyFirstUniverse/src/com/company/universe/PlanetaryNebula.java index 265368e..41e7956 100644 --- a/MyFirstUniverse/src/com/company/universe/PlanetaryNebula.java +++ b/MyFirstUniverse/src/com/company/universe/PlanetaryNebula.java @@ -1,25 +1,25 @@ -package com.company.universe; - -public class PlanetaryNebula { - - private String name; - private long size; - private long lifeDuration; - private long x, y , z; - -// public PlanetaryNebula(){ -// size = 0; -// lifeDuration = 0; -// x = 0; y = 0; z=0; -// } - - public PlanetaryNebula(String name,long lifeDuration, long size, long x, long y, long z) { - this.name = name; - this.lifeDuration = lifeDuration; - this.size = size; - this.x = x; - this.y = y; - this.z = z; - } -} - +package com.company.universe; + +public class PlanetaryNebula { + + private String name; + private long size; + private long lifeDuration; + private long x, y , z; + + public PlanetaryNebula(){ + size = 0; + lifeDuration = 0; + x = 0; y = 0; z=0; + } + + public PlanetaryNebula(String name,long lifeDuration, long size, long x, long y, long z) { + this.name = name; + this.lifeDuration = lifeDuration; + this.size = size; + this.x = x; + this.y = y; + this.z = z; + } +} + From 54ff3576869e3b7aaf6e64443f2ae2a767ffb10c Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Mon, 7 Nov 2022 22:20:31 +0000 Subject: [PATCH 6/8] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'MyFirstUniverse/src/com/company/Main.?= =?UTF-8?q?java'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyFirstUniverse/src/com/company/Main.java | 81 +++++++++++------------ 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/MyFirstUniverse/src/com/company/Main.java b/MyFirstUniverse/src/com/company/Main.java index 7b26f5d..808dc28 100644 --- a/MyFirstUniverse/src/com/company/Main.java +++ b/MyFirstUniverse/src/com/company/Main.java @@ -1,42 +1,41 @@ -package com.company; - -import com.company.cosmicbody.Planet; -import com.company.cosmicbody.SolarSystem; -import com.company.cosmicbody.Star; -import com.company.universe.PlanetaryNebula; -import com.company.universe.Universe; - -public class Main { - - public static void main(String[] args) { - Universe myuniverse = new Universe(); - myuniverse.startUniverse(); - - PlanetaryNebula orion = new PlanetaryNebula("Orion",5, 18000,200,200,200); - PlanetaryNebula buba = new PlanetaryNebula("Buba", 8, 2300, 12,59,94); - PlanetaryNebula phonk = new PlanetaryNebula("Phonk", 20, 100000, 0,0,0); - - Planet Mercury = new Planet("Mercury", 1333, 6083); - Planet Venus = new Planet("Venus", 4867, 938); - Planet Earth = new Planet("Earth", 100000, 108321); - Planet Mars = new Planet("Mars", 641, 16318); - Planet Jupiter = new Planet("Jupiter", 3, 71313); - Planet Saturn = new Planet("Saturn", 1000, 108408); - Planet Uranus = new Planet("Uranus", 1000, 202156); - Planet Neptune = new Planet("Neptune", 7050, 620654); - - Star sun = new Star("Sun", 1.392, 1.40927, 1499726.85); - SolarSystem solarSystem = new SolarSystem(); - solarSystem.addBody(Mercury); - solarSystem.addBody(Venus); - solarSystem.addBody(Earth); - solarSystem.addBody(Mars); - solarSystem.addBody(Jupiter); - solarSystem.addBody(Saturn); - solarSystem.addBody(Uranus); - solarSystem.addBody(Neptune); - - - myuniverse.stopUniverse(); - } +package com.company; + +import com.company.cosmicbody.Planet; +import com.company.cosmicbody.SolarSystem; +import com.company.cosmicbody.Star; +import com.company.universe.PlanetaryNebula; +import com.company.universe.Universe; + +public class Main { + + public static void main(String[] args) { + Universe myuniverse = new Universe(); + + PlanetaryNebula orion = new PlanetaryNebula("Orion",5, 18000,200,200,200); + PlanetaryNebula buba = new PlanetaryNebula("Buba", 8, 2300, 12,59,94); + PlanetaryNebula phonk = new PlanetaryNebula("Phonk", 20, 100000, 0,0,0); + + Planet Mercury = new Planet("Mercury", 1333, 6083); + Planet Venus = new Planet("Venus", 4867, 938); + Planet Earth = new Planet("Earth", 100000, 108321); + Planet Mars = new Planet("Mars", 641, 16318); + Planet Jupiter = new Planet("Jupiter", 3, 71313); + Planet Saturn = new Planet("Saturn", 1000, 108408); + Planet Uranus = new Planet("Uranus", 1000, 202156); + Planet Neptune = new Planet("Neptune", 7050, 620654); + + Star sun = new Star("Sun", 1.392, 1.40927, 1499726.85); + SolarSystem solarSystem = new SolarSystem(); + solarSystem.addBody(Mercury); + solarSystem.addBody(Venus); + solarSystem.addBody(Earth); + solarSystem.addBody(Mars); + solarSystem.addBody(Jupiter); + solarSystem.addBody(Saturn); + solarSystem.addBody(Uranus); + solarSystem.addBody(Neptune); + + + myuniverse.stopUniverse(); + } } \ No newline at end of file From 631c240ea3923733da98e053e0c23c5245f8ea7c Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Mon, 7 Nov 2022 22:24:09 +0000 Subject: [PATCH 7/8] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'MyFirstUniverse/src/com/company/cosmi?= =?UTF-8?q?cbody/Planet.java'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyFirstUniverse/src/com/company/cosmicbody/Planet.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MyFirstUniverse/src/com/company/cosmicbody/Planet.java b/MyFirstUniverse/src/com/company/cosmicbody/Planet.java index 2591ef9..d67b2bc 100644 --- a/MyFirstUniverse/src/com/company/cosmicbody/Planet.java +++ b/MyFirstUniverse/src/com/company/cosmicbody/Planet.java @@ -94,10 +94,10 @@ public class Planet extends CosmicBody { this.gravitation = gravitation; } -// public Planet() { -// this.name = "Zem"; -// this.weight = 5972200; -// this.diameter = 12756; -// } + public Planet() { + this.name = "Earth"; + this.weight = 5972200; + this.diameter = 12756; + } } From e7a72f2d8ed454e47032594059f5225f8846aa00 Mon Sep 17 00:00:00 2001 From: Oleksandr Hryshchenko Date: Mon, 7 Nov 2022 22:29:05 +0000 Subject: [PATCH 8/8] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C?= =?UTF-8?q?=20'MyFirstUniverse/.idea/.gitignore'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MyFirstUniverse/.idea/.gitignore | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 MyFirstUniverse/.idea/.gitignore diff --git a/MyFirstUniverse/.idea/.gitignore b/MyFirstUniverse/.idea/.gitignore deleted file mode 100644 index 1c2fda5..0000000 --- a/MyFirstUniverse/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml