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
private static void SolveLinearEquations(int a, int b, int c, int d, int e, int f) { | |
float D = a * d - c * b; | |
float Dx = e * d - f * b; | |
float Dy = a * f - c * e; | |
if (D != 0) { | |
// решение единственное | |
float x = Dx / D; | |
float y = Dy / D; |
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
private static void Prisoner(int A, int B, int C, int D, int E) { | |
if (A <= D && B <= E || A <= E && B <= D) System.out.println("YES"); | |
else if (C <= D && B <= E || C <= E && B <= D) System.out.println("YES"); | |
else if (A <= D && C <= E || A <= E && C <= D) System.out.println("YES"); | |
else System.out.println("NO"); | |
} |
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
private static void GetMinimumDistanceToPoolEdge(int N, int M, int x, int y) { | |
// находим длинный бортик | |
if (N > M) { | |
int tmp = N; | |
N = M; | |
M = tmp; | |
} | |
if (x >= N / 2) { | |
x = N - x; |
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
private static void CheckBoxEquality(int a1, int b1, int c1, int a2, int b2, int c2) { | |
/* | |
Идея: решение довольно очевидное, по сути нам нужно просто упорядочить размеры каждой коробки, чтобы A <= B <= C. | |
Дальше проверяем все четыре случая: | |
1. A1 >= A2, B1 >= B2, C1 >= C2 - первая коробка больше второй |
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
using UnityEngine; | |
using UnityEngine.UI; | |
using UnityEngine.Events; | |
public class Collector : MonoBehaviour | |
{ | |
private int score; | |
public int goal; | |
public string objectTag; |
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
using UnityEngine; | |
using UnityEngine.Events; | |
public class ObjectTrigger : MonoBehaviour | |
{ | |
// Тэг объекта, который мы ожидаем в триггере | |
public string objectTag; | |
// События, содержащие в себе вызовы функций | |
public UnityEvent OnObjectEnter, OnObjectStay, OnObjectExit; |
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
using UnityEngine; | |
public class Character : MonoBehaviour | |
{ | |
// Базовое количество жизней | |
private const int baseHealth = 100; | |
// Количество жизней персонажа в начале делаем базовым | |
private static int health = baseHealth; |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using UnityEngine; | |
public class ListFiller : MonoBehaviour | |
{ | |
void Awake () |
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
package chi.utils; | |
import java.io.*; | |
import java.util.HashMap; | |
import java.util.Properties; | |
public class ConfigManager { | |
private final File config_file; | |
private static HashMap<String, String> preferences; |
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
using System; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Localization : MonoBehaviour | |
{ | |
public enum Language | |
{ | |
ENGLISH, |