Added project

This commit is contained in:
2023-06-11 00:35:07 +03:00
parent 5bfa765889
commit f06629200c
545 changed files with 44339 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
using UnityEngine;
public class Hw2P1 : MonoBehaviour {
public int sideOfSquare = 2;
public int sideAofRectangle = 3;
public int sideBOfRectangle = 4;
public float circleRadius = 3.5f;
// Start is called before the first frame update
void Start() {
int squareArea = sideOfSquare * sideOfSquare;
int rectangleArea = sideAofRectangle * sideBOfRectangle;
float circleArea = Mathf.PI * circleRadius * circleRadius;
Debug.Log($"Площадь квадрата со стороной {sideOfSquare} равна {squareArea}");
Debug.Log($"Площадь прямоугольника сооронами A = {sideAofRectangle} и B = {sideBOfRectangle} равна {rectangleArea}");
Debug.Log($"Площадь окружности с радиусом R = {circleRadius} равна {circleArea}");
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ce93cea7541f36a0c82f8cc6c3ff6ce2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,40 @@
using UnityEngine;
public class Hw2P2 : MonoBehaviour {
public int apples = 3;
public int oranges = 5;
public int tomatoes = 2;
// Start is called before the first frame update
void Start() {
if (apples >= oranges) {
if (oranges >= tomatoes) {
Debug.Log("Яблоки");
Debug.Log("Апельсины");
Debug.Log("Помидоры");
} else if (tomatoes >= apples) {
Debug.Log("Помидоры");
Debug.Log("Яблоки");
Debug.Log("Апельсины");
} else {
Debug.Log("Яблоки");
Debug.Log("Помидоры");
Debug.Log("Апельсины");
}
} else if (tomatoes >= oranges) {
Debug.Log("Помидоры");
Debug.Log("Апельсины");
Debug.Log("Яблоки");
} else if (apples >= tomatoes) {
Debug.Log("Апельсины");
Debug.Log("Яблоки");
Debug.Log("Помидоры");
} else {
Debug.Log("Апельсины");
Debug.Log("Помидоры");
Debug.Log("Яблоки");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 97483f62e206c8a3bb3dd7e9b48bce1a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,16 @@
using UnityEngine;
public class Hw2P3 : MonoBehaviour {
// Start is called before the first frame update
void Start() {
long paperThickness = 1;
long distanceFromEarthToMoon = 300000L * 1000L * 100L * 10L;
int count = 0;
while (paperThickness < distanceFromEarthToMoon) {
paperThickness *= 2;
count++;
}
Debug.Log($"{count} раз необходимо сложить бесконечный лист бумаги что бы достичь Луны");
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5ca837ad9bf5423f3ab25ca6f519b890
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,15 @@
using UnityEngine;
using Random = UnityEngine.Random;
public class Hw2P4 : MonoBehaviour {
public SpriteRenderer[] spriteRenderers;
// Start is called before the first frame update
void Start() {
foreach (var spriteRenderer in spriteRenderers) {
spriteRenderer.color = new Color(Random.value, Random.value, Random.value, 1f);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d4f1d31e30ae19339b55437ae98064a2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
using UnityEngine;
public class Hw2P5P6P7 : MonoBehaviour {
// Start is called before the first frame update
void Start() {
Debug.Log(compare(3, 4));
printMessage();
Debug.Log(circleArea(3.5f));
}
public bool compare(int x, int y) {
return x > y;
}
public void printMessage() {
Debug.Log("Hello World!");
}
public float circleArea(float radius) {
return Mathf.PI * (radius * radius);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 145a41c92580bdd42b2157e0b69ebf65
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: