diff --git a/Collections/Valeriya/Collections.cs b/Collections/Valeriya/Collections.cs index df4174f..16a0ab5 100644 --- a/Collections/Valeriya/Collections.cs +++ b/Collections/Valeriya/Collections.cs @@ -93,7 +93,7 @@ public List ProcessData(IReadOnlyList inputData) for (int i = 0; i < sumsFromSensors.Count; i++) { - sensorsAverage.Add(new OutData(codesOfSensors[i], sumsFromSensors[i] / countOfValuesFromEachSensor[i])); + //sensorsAverage.Add(new OutData(codesOfSensors[i], sumsFromSensors[i] / countOfValuesFromEachSensor[i])); } return sensorsAverage; diff --git a/Collections/Valeriya/OutData.cs b/Collections/Valeriya/OutData.cs index 51561e7..965d4f6 100644 --- a/Collections/Valeriya/OutData.cs +++ b/Collections/Valeriya/OutData.cs @@ -6,14 +6,5 @@ namespace Collections.Valeriya { - class OutData : IOutData - { - public int Code { get; } - public double Average { get; } - public OutData (int code, double average) - { - this.Code = code; - this.Average = average; - } - } + } diff --git a/Encapsulation/Alina/ComplexNumbers.cs b/Encapsulation/Alina/ComplexNumbers.cs deleted file mode 100644 index c2d0649..0000000 --- a/Encapsulation/Alina/ComplexNumbers.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Alina -{ - class ComplexNumbers - { - double real; - double imaginary; - public ComplexNumbers(double real, double imaginary) - { - this.real = real; - this.imaginary = imaginary; - } - double Real { get { return real; } } - double Imaginary { get { return imaginary; } } - public static ComplexNumbers operator +(ComplexNumbers operand1, ComplexNumbers operand2) - { - return new ComplexNumbers(operand1.real + operand2.real, operand2.imaginary + operand2.imaginary); - } - public static ComplexNumbers operator -(ComplexNumbers operand1, ComplexNumbers operand2) - { - return new ComplexNumbers(operand1.real - operand2.real, operand2.imaginary - operand2.imaginary); - } - public static ComplexNumbers operator *(ComplexNumbers operand1, ComplexNumbers operand2) - { - return new ComplexNumbers((operand1.real * operand2.real - operand1.imaginary * operand2.imaginary), (operand1.real * operand2.imaginary + operand1.imaginary * operand2.real)); - } - public static ComplexNumbers operator *(ComplexNumbers operand1, int coefficient) - { - return new ComplexNumbers(operand1.real * coefficient, operand1.imaginary * coefficient); - } - public static ComplexNumbers operator /(ComplexNumbers operand1, ComplexNumbers operand2) - { - return new ComplexNumbers((operand1.real * operand2.real + operand1.imaginary * operand2.imaginary) / (operand2.imaginary * operand2.imaginary + operand2.real * operand2.real), - (operand1.imaginary * operand2.real - operand1.real * operand2.imaginary) / (operand2.imaginary * operand2.imaginary + operand2.real * operand2.real)); - } - public static ComplexNumbers operator /(ComplexNumbers operand1, int denominator) - { - return new ComplexNumbers(operand1.real / denominator, operand1.imaginary / denominator); - } - public static bool operator ==(ComplexNumbers operand1, ComplexNumbers operand2) - { - bool isSame = false; - if (operand1.real == operand2.real && operand1.imaginary == operand2.imaginary) - { - isSame = true; - } - return isSame; - } - public static bool operator !=(ComplexNumbers operand1, ComplexNumbers operand2) - { - bool isSame = false; - if (operand1.real != operand2.real || operand1.imaginary == operand2.imaginary) - { - isSame = true; - } - return isSame; - } - public override string ToString() - { - return String.Format("{0} + {1}i", Real, Imaginary); - } - } -} diff --git a/Encapsulation/Alina/EncapsulationExercises.cs b/Encapsulation/Alina/EncapsulationExercises.cs index 40a0018..5d77a3f 100644 --- a/Encapsulation/Alina/EncapsulationExercises.cs +++ b/Encapsulation/Alina/EncapsulationExercises.cs @@ -10,138 +10,13 @@ class EncapsulationExercises : IEncapsulationExercises { public void MoneyMoney() { - Money m1 = new Money(25, 51); - Money m2 = new Money(1, 58); - Money m3 = new Money(1005); - int hrivnas = m1.Hrivnas; - Console.WriteLine("{0} грн", hrivnas); - int kopecs = m1.Kopeks; - Console.WriteLine("{0} коп", kopecs); - int hrivnas2 = m2.Hrivnas; - Console.WriteLine("{0} грн", hrivnas2); - int kopecs2 = m2.Kopeks; - Console.WriteLine("{0} коп", kopecs2); - int hrivnas3 = m3.Hrivnas; - Console.WriteLine("{0} грн", hrivnas3); - int kopecs3 = m3.Kopeks; - Console.WriteLine("{0} коп", kopecs3); - Money m4 = m2 + m3; - Console.WriteLine(m4.ToString()); - Money m5 = m1 - m3; - Console.WriteLine(m5.ToString()); - Money m6 = m1 * 2; - Console.WriteLine(m6.ToString()); - Money m7 = m3 / 5; - Console.WriteLine(m7.ToString()); - bool isMatrix1EqualMatrix2 = m1 == m2; - Console.WriteLine(isMatrix1EqualMatrix2); - bool isMatrix1NotEqualMatrix2 = m1 != m2; - Console.WriteLine(isMatrix1NotEqualMatrix2); - bool isMatrix1LargeMatrix2 = m1 > m2; - Console.WriteLine(isMatrix1LargeMatrix2); - bool isMatrix1LessMatrix2 = m1 < m2; - Console.WriteLine(isMatrix1LessMatrix2); - Money m12 = Money.Clone(m2); - Console.WriteLine(m12); - - //------------------------------------------------------------------ - // class Matrix - - int[,] myArr1 = new int[,] - { - {2,2,2,2,2}, - {2,2,2,2,2}, - {2,2,2,2,2}, - }; - int[,] myArr2 = new int[,] - { - {1,1,1,1,1}, - {1,1,1,1,1}, - {1,1,1,1,1}, - }; - Matrix matrix1 = new Matrix(myArr1); - Matrix matrix2 = new Matrix(myArr2); - Matrix matrix3 = matrix1 + matrix2; - Matrix matrix4 = matrix1 - matrix2; - Matrix matrix5 = matrix1 * 5; - Matrix.PrintMatrix(matrix1); - Matrix.PrintMatrix(matrix3); - Matrix.PrintMatrix(matrix5); - - //------------------------------------------------------------------ - // class ComplexNumbers - - ComplexNumbers number1 = new ComplexNumbers(4, 8); - ComplexNumbers number2 = new ComplexNumbers(3, 7); - ComplexNumbers number3 = number1 + number2; - ComplexNumbers number4 = number1 - number2; - ComplexNumbers number5 = number1 * number2; - ComplexNumbers number6 = number1 / number2; - ComplexNumbers number7 = number1 * 2; - ComplexNumbers number8 = number1 / 2; - Console.WriteLine(number1); - Console.WriteLine(number4); - Console.WriteLine(number5); - Console.WriteLine(number6); - Console.WriteLine(number7); - Console.WriteLine(number8); - bool isNumber1EqualNumber2 = number1 == number2; - bool isNumber1NotEqualNumber2 = number1 != number2; - Console.WriteLine(isNumber1EqualNumber2); - Console.WriteLine(isNumber1NotEqualNumber2); - - Console.ReadKey(); - + throw new NotImplementedException(); } public void WorkPriorityQueue() { - Student firstStudent = new Student("Alina", "Kylish", 123456789, new DateTime(1988, 4, 3)); - Student secondStudent = new Student("Elena", "Kylish", 987654321, new DateTime(1987, 8, 15)); - Student thirdStudent = new Student("Oleg", "Ivanov", 975312468, new DateTime(1992, 11, 20)); - Student fourthStudent = new Student("Andrey", "Pavlov", 1243576890, new DateTime(1977, 8, 10)); - PriorityQueue students = new PriorityQueue(); - students.Enqueue(firstStudent, 0); - students.Enqueue(secondStudent, 1); - students.Enqueue(thirdStudent, 2); - students.Enqueue(fourthStudent, 0); - Console.WriteLine(students.Count()); - Console.WriteLine(students.First()); - Console.WriteLine(students.Last()); - students.Dequeue(); - Console.WriteLine(students.Count()); - Console.ReadKey(); - students.Clear(); - students.Dequeue(); // throw exeption with message "Queue is empty. There is no value in queue" - } - - public void WorkCollectionInheritedClasses() - { - Student firstStudent = new Student("Alina", "Kylish", 123456789, new DateTime(1988, 4, 3)); - Student secondStudent = new Student("Elena", "Kylish", 987654321, new DateTime(1987, 8, 15)); - Student thirdStudent = new Student("Oleg", "Ivanov", 975312468, new DateTime(1992, 11, 20)); - MyDictionary students = new MyDictionary(); - Tuple key = new Tuple("Alina", "Kylish", 123456789); - students.Add(firstStudent); - if (!students.Contains(key)) - { - Console.WriteLine("This key is not found"); - } - else - { - Console.WriteLine("This key is found"); - } - - MyCollection students1 = new MyCollection(); - students1.Add(firstStudent); - students1.Add(secondStudent); - students1.Insert(0, thirdStudent); - students1.Add(firstStudent); - students1.Remove(firstStudent); - students1.Clear(); - Console.ReadKey(); - + throw new NotImplementedException(); } } } diff --git a/Encapsulation/Alina/GeneralizedMatrix.cs b/Encapsulation/Alina/GeneralizedMatrix.cs deleted file mode 100644 index aef0a83..0000000 --- a/Encapsulation/Alina/GeneralizedMatrix.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Alina -{ - class GeneralizedMatrix - { - T[,] matrix; - int matrixHigh; - int MatrixHigh { get { return matrixHigh; } } - int matrixWidth; - int MatrixWidth { get { return matrixWidth; } } - public GeneralizedMatrix(int matrixHigh, int matrixWidth) - { - this.matrixHigh = matrixHigh; - this.matrixWidth = matrixWidth; - matrix = new T[matrixHigh, matrixWidth]; - } - public GeneralizedMatrix(T[,] matrix) - { - this.matrix = matrix; - } - public T this[int row, int col] - { - get - { - return matrix[row, col]; - } - set - { - matrix[row, col] = value; - } - } - } -} diff --git a/Encapsulation/Alina/Matrix.cs b/Encapsulation/Alina/Matrix.cs deleted file mode 100644 index 5f86138..0000000 --- a/Encapsulation/Alina/Matrix.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Alina -{ - public class Matrix - { - int[,] matrix; - int matrixHigh; - int MatrixHigh { get { return matrixHigh; } } - int matrixWidth; - int MatrixWidth { get { return matrixWidth; } } - public Matrix(int matrixHigh, int matrixWidth) - { - this.matrixHigh = matrixHigh; - this.matrixWidth = matrixWidth; - matrix = new int[matrixHigh, matrixWidth]; - } - public Matrix(int[,] matrix) - { - this.matrix = matrix; - this.matrixHigh = matrix.GetLength(0); - this.matrixWidth = matrix.GetLength(1); - } - - public int this[int index1, int index2] - { - get - { - return matrix[index1, index2]; - } - set - { - matrix[index1, index2] = value; - } - } - - public static Matrix operator +(Matrix operand1, Matrix operand2) - { - int[,] sum = new int[operand1.matrixHigh, operand1.matrixWidth]; - for (int i = 0; i < operand1.matrixHigh; i++) - { - for (int j = 0; j < operand1.matrixWidth; j++) - { - sum[i, j] = operand1[i, j] + operand2[i, j]; - } - } - return new Matrix(sum); - } - public static Matrix operator -(Matrix operand1, Matrix operand2) - { - int[,] residual = new int[operand1.matrixHigh, operand1.matrixWidth]; - for (int i = 0; i < operand1.matrixHigh; i++) - { - for (int j = 0; j < operand1.matrixWidth; j++) - { - residual[i, j] = operand1[i, j] - operand2[i, j]; - } - } - return new Matrix(residual); - } - public static Matrix operator *(Matrix operand1, int operand2) - { - int[,] result = new int[operand1.matrixHigh, operand1.matrixWidth]; - for (int i = 0; i < operand1.matrixHigh; i++) - { - for (int j = 0; j < operand1.matrixWidth; j++) - { - result[i, j] = operand1[i, j] * operand2; - } - } - return new Matrix(result); - } - public static Matrix operator /(Matrix operand1, int operand2) - { - int[,] result = new int[operand1.matrixHigh, operand1.matrixWidth]; - for (int i = 0; i < operand1.matrixHigh; i++) - { - for (int j = 0; j < operand1.matrixWidth; j++) - { - result[i, j] = operand1[i, j] / operand2; - } - } - return new Matrix(result); - } - - public static void PrintMatrix(Matrix matrix) - { - for (int i = 0; i < matrix.MatrixHigh; i++) - { - for (int j = 0; j < matrix.matrixWidth; j++) - { - Console.Write("{0}", matrix[i, j]); - } - Console.Write(Environment.NewLine); - } - } - - } -} diff --git a/Encapsulation/Alina/Money.cs b/Encapsulation/Alina/Money.cs deleted file mode 100644 index 7486376..0000000 --- a/Encapsulation/Alina/Money.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Alina -{ - class Money - { - int kopeks; - - public int Hrivnas - { - get - { - return kopeks / 100; - } - } - public int Kopeks - { - get - { - return kopeks%100; - } - } - public int TotalKopeks - { - get { return kopeks; } - } - public Money() - { - - } - public Money(int kopeks) - : this(0, kopeks) - { - - } - public Money(int hrivnas, int kopeks) - { - this.kopeks = hrivnas*100 + kopeks; - } - - public static Money Clone (Money original) - { - return new Money(original.TotalKopeks); - } - public static Money operator + (Money operand1, Money operand2) - { - return new Money(operand1.kopeks + operand2.kopeks); - } - public static Money operator -(Money operand1, Money operand2) - { - return new Money(operand1.kopeks - operand2.kopeks); - } - public static Money operator * (Money operand1, int operand2) - { - return new Money(operand1.kopeks * operand2); - } - public static Money operator / (Money operand1, int operand2) - { - return new Money(operand1.kopeks / operand2); - } - public static bool operator == (Money operand1, Money operand2) - { - return operand1.kopeks == operand2.kopeks; - } - public static bool operator != (Money operand1, Money operand2) - { - return operand1.kopeks != operand2.kopeks; - } - public static bool operator > (Money operand1, Money operand2) - { - return operand1.kopeks > operand2.kopeks; - } - public static bool operator >= (Money operand1, Money operand2) - { - return operand1.kopeks >= operand2.kopeks; - } - public static bool operator < (Money operand1, Money operand2) - { - return operand1.kopeks < operand2.kopeks; - } - public static bool operator <= (Money operand1, Money operand2) - { - return operand1.kopeks <= operand2.kopeks; - } - - public override string ToString() - { - return String.Format("{0} грн {1} коп", Hrivnas, Kopeks); - } - } -} diff --git a/Encapsulation/Alina/MyCollection.cs b/Encapsulation/Alina/MyCollection.cs deleted file mode 100644 index 1575b3c..0000000 --- a/Encapsulation/Alina/MyCollection.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Alina -{ - public class MyCollection: Collection - { - protected override void ClearItems() - { - base.ClearItems(); - Console.WriteLine("MyCollection was cleared {0}", DateTime.Now); - } - protected override void RemoveItem(int index) - { - base.RemoveItem(index); - Console.WriteLine("1 item was removed from MyCollection at {0}", DateTime.Now); - } - protected override void SetItem(int index, Student item) - { - base.SetItem(index, item); - Console.WriteLine("1 item was replaced in MyCollection at {0}", DateTime.Now); - - } - protected override void InsertItem(int index, Student item) - { - base.InsertItem(index, item); - Console.WriteLine("1 item was inserted in MyCollection at {1} index, {0}", DateTime.Now, index); - } - - } -} diff --git a/Encapsulation/Alina/MyDictionary.cs b/Encapsulation/Alina/MyDictionary.cs deleted file mode 100644 index 2eeea10..0000000 --- a/Encapsulation/Alina/MyDictionary.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Alina -{ - public class MyDictionary : KeyedCollection , Student> - { - protected override Tuple GetKeyForItem(Student item) - { - Tuple myKey = new Tuple(item.FirstName, item.LastName, item.PersonalCode); - return myKey; - } - } -} diff --git a/Encapsulation/Alina/PriorityQueue.cs b/Encapsulation/Alina/PriorityQueue.cs deleted file mode 100644 index 9bcc91e..0000000 --- a/Encapsulation/Alina/PriorityQueue.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Alina -{ - class PriorityQueue : IPriorityQueue, ICollection> - { - SortedDictionary> myQueue = new SortedDictionary>(); - public void Enqueue(T val, int priority) - { - if (!myQueue.ContainsKey(priority)) - { - myQueue.Add(priority, new Queue()); - } - myQueue[priority].Enqueue(val); - } - - public T Dequeue() - { - try - { - return myQueue.First().Value.Dequeue(); - } - catch (Exception e) - { - throw new Exception("Queue is empty. There is no value in queue", e); - } - } - - public T First() - { - try - { - return myQueue.First().Value.Peek(); - } - catch (Exception e) - { - throw new Exception("Queue is empty. There is no value in queue", e); - } - } - - public T First(int priority) - { - if (!myQueue.ContainsKey(priority) || myQueue[priority].Count == 0) - { - throw new Exception("There is no value with such priority"); - } - return myQueue[priority].Peek(); - } - - public T Last() - { - try - { - return myQueue.Last().Value.ElementAt(myQueue.Last().Value.Count - 1); - } - catch (Exception e) - { - throw new Exception("Queue is empty. There is no value in queue", e); - } - } - - public T Last(int priority) - { - if (!myQueue.ContainsKey(priority) || myQueue[priority].Count == 0) - { - throw new Exception("There is no value with such priority"); - } - return myQueue[priority].Last(); - } - - public int Count - { - get { return myQueue.Values.Sum(q => q.Count); } - } - - public int GetCount(int priority) - { - return myQueue[priority].Count; - } - - public void Add(Tuple item) - { - if (!myQueue.ContainsKey(item.Item1)) - { - myQueue.Add(item.Item1, new Queue()); - } - myQueue[item.Item1].Enqueue(item.Item2); - } - public bool Remove(Tuple item) - { - bool isRemoved = false; - if (myQueue.ContainsKey(item.Item1)) - { - myQueue.Remove(item.Item1); - isRemoved = true; - } - return isRemoved; - } - public bool Contains(Tuple item) - { - return myQueue.Values.Any(x => x.Contains(item.Item2)); - } - - public void CopyTo(Tuple[] array, int arrayIndex) - { - int count = 0; - Tuple[] tuple = new Tuple[myQueue.Values.Sum(q => q.Count)]; - foreach (var item in myQueue) - { - tuple[count] = new Tuple(item.Key, item.Value.Peek()); - count++; - } - } - public void Clear() - { - myQueue.Clear(); - } - - public bool IsReadOnly - { - get - { - return false; - } - } - - public IEnumerator> GetEnumerator() - { - foreach (var key in myQueue) - { - foreach (var value in key.Value) - { - yield return new Tuple(key.Key, value); - } - } - } - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} - diff --git a/Encapsulation/Alina/Student.cs b/Encapsulation/Alina/Student.cs deleted file mode 100644 index 1dd8164..0000000 --- a/Encapsulation/Alina/Student.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Alina -{ - public class Student - { - public string FirstName { get; private set; } - public string LastName { get; private set; } - public DateTime BirthDate { get; private set; } - public int PersonalCode { get; private set; } - public Student(string firstName, string lastName, int personalCode, DateTime birthDate) - { - FirstName = firstName; - LastName = lastName; - PersonalCode = personalCode; - BirthDate = birthDate; - } - public override string ToString() - { - return String.Format(FirstName, LastName, BirthDate, PersonalCode); - } - } -} diff --git a/Encapsulation/Andrey/EncapsulationExercises.cs b/Encapsulation/Andrey/EncapsulationExercises.cs index 1e291b7..7cc47ed 100644 --- a/Encapsulation/Andrey/EncapsulationExercises.cs +++ b/Encapsulation/Andrey/EncapsulationExercises.cs @@ -8,7 +8,6 @@ namespace Encapsulation.Andrey { class EncapsulationExercises : IEncapsulationExercises { - public void MoneyMoney() { throw new NotImplementedException(); @@ -19,11 +18,5 @@ public void WorkPriorityQueue() { throw new NotImplementedException(); } - - - public void WorkCollectionInheritedClasses() - { - throw new NotImplementedException(); - } -} + } } diff --git a/Encapsulation/Elena/ComplexNumber.cs b/Encapsulation/Elena/ComplexNumber.cs index 2b81670..82851d5 100644 --- a/Encapsulation/Elena/ComplexNumber.cs +++ b/Encapsulation/Elena/ComplexNumber.cs @@ -69,23 +69,17 @@ public float Imegion { return new ComplexNumber(operand1.real / div, operand1.imegion / div); } - else { return null; } + else { throw new System.DivideByZeroException(); } } public static bool operator ==(ComplexNumber operand1, ComplexNumber operand2) { - bool returnValue = false; - if (operand1.real == operand2.real && operand1.imegion == operand2.imegion) - { returnValue = true; } - return returnValue; + return operand1.real == operand2.real && operand1.imegion == operand2.imegion; } public static bool operator !=(ComplexNumber operand1, ComplexNumber operand2) { - bool returnValue = false; - if (operand1.real != operand2.real && operand1.imegion != operand2.imegion) - { returnValue = true; } - return returnValue; + return operand1.real != operand2.real && operand1.imegion != operand2.imegion; } public static implicit operator string(ComplexNumber operand1) diff --git a/Encapsulation/Elena/EncapsulationExercises.cs b/Encapsulation/Elena/EncapsulationExercises.cs index 58b8cff..125d16c 100644 --- a/Encapsulation/Elena/EncapsulationExercises.cs +++ b/Encapsulation/Elena/EncapsulationExercises.cs @@ -22,14 +22,14 @@ public void MoneyMoney() float someMoney = (float)m2; string amount = (string)m2; - ComplexNumber c1 = new ComplexNumber(2,3); + ComplexNumber c1 = new ComplexNumber(2, 3); ComplexNumber c2 = new ComplexNumber(-8, 5); ComplexNumber c3 = c1 + c2; c3 = c1 - c2; c3 = c1 * 2; c3 = c1 * c2; - c3=c1/4; + c3 = c1 / 4; c3 = c1 / c2; string complexNumber = (string)c2; @@ -72,8 +72,8 @@ public void WorkCollectionInheritedClasses() collection.Add(new Student() { FirstName = "Victoriya", LastName = "Stashatova", ApplicationDate = new DateTime(2014, 08, 21), personalCode = 2012445566, Rating = 5, BirthDay = new DateTime(1978, 09, 17) }); collection.Insert(2, new Student() { FirstName = "Angelina", LastName = "Kucherova", ApplicationDate = new DateTime(2014, 12, 01), personalCode = 222025566, Rating = 4, BirthDay = new DateTime(1984, 12, 30) }); - collection.Remove(new Student(){FirstName = "Ivan", LastName = "Ivanov", ApplicationDate = new DateTime(2015, 01, 01), personalCode = 2012365566, Rating = 5, BirthDay = new DateTime(1990, 01, 05)}); - // collection. .Set(2, new Student() { FirstName = "Sergey", LastName = "Kuprin", ApplicationDate = new DateTime(2013, 12, 08), personalCode = 6545566, Rating = 1, BirthDay = new DateTime(1987, 02, 15) }); + collection.Remove(new Student() { FirstName = "Ivan", LastName = "Ivanov", ApplicationDate = new DateTime(2015, 01, 01), personalCode = 2012365566, Rating = 5, BirthDay = new DateTime(1990, 01, 05) }); + // collection. .Set(2, new Student() { FirstName = "Sergey", LastName = "Kuprin", ApplicationDate = new DateTime(2013, 12, 08), personalCode = 6545566, Rating = 1, BirthDay = new DateTime(1987, 02, 15) }); collection.Clear(); } diff --git a/Encapsulation/Elena/PriorityQueue.cs b/Encapsulation/Elena/PriorityQueue.cs index f705137..8f83e23 100644 --- a/Encapsulation/Elena/PriorityQueue.cs +++ b/Encapsulation/Elena/PriorityQueue.cs @@ -6,20 +6,20 @@ namespace Encapsulation.Elena { - - public class PriorityQueue : IPriorityQueue - , ICollection> + + public class PriorityQueue : IPriorityQueue + , ICollection> { - private int priority; + private int priority; private Queue queueForPriority; - public SortedSet> OurSetWhithData=new SortedSet>();//(new SortQueueByPriority()); + public SortedSet> OurSetWhithData = new SortedSet>();//(new SortQueueByPriority()); public int Priority { get { return priority; } } - + public PriorityQueue(int p, Queue q) { priority = p; @@ -30,7 +30,6 @@ public void Enqueue(T val, int priority) { bool isPriorityExist = false; foreach (PriorityQueue p in OurSetWhithData) - { if (p.priority == priority) { @@ -43,31 +42,31 @@ public void Enqueue(T val, int priority) { Queue q = new Queue(); q.Enqueue(val); - + OurSetWhithData.Add(new PriorityQueue(priority, q)); } - + } public T Dequeue() { - if(this.Count<=0) - { - throw new InvalidOperationException(); - } + if (this.Count <= 0) + { + throw new InvalidOperationException(); + } - return OurSetWhithData.First>().queueForPriority.Dequeue(); + return OurSetWhithData.First>().queueForPriority.Dequeue(); } public T First() { - if(this.Count<=0) - { - throw new InvalidOperationException(); - } - return OurSetWhithData.First>().queueForPriority.Peek(); - + if (this.Count <= 0) + { + throw new InvalidOperationException(); + } + return OurSetWhithData.First>().queueForPriority.Peek(); + } public T First(int priority) @@ -86,16 +85,16 @@ public T First(int priority) } catch { throw new InvalidOperationException(); } - + } public T Last() { - if(this.Count<=0) - { - throw new InvalidOperationException(); - } - return OurSetWhithData.Last>().queueForPriority.Last(); + if (this.Count <= 0) + { + throw new InvalidOperationException(); + } + return OurSetWhithData.Last>().queueForPriority.Last(); } public T Last(int priority) @@ -106,7 +105,7 @@ public T Last(int priority) { if (p.priority == priority) { - return p.queueForPriority.Last(); + return p.queueForPriority.Last(); } } throw new InvalidOperationException(); @@ -118,28 +117,28 @@ public T Last(int priority) public int Count { - get + get { - int allCount=0; + int allCount = 0; try { foreach (PriorityQueue p in OurSetWhithData) { - - allCount += p.queueForPriority.Count(); - + + allCount += p.queueForPriority.Count(); + } } catch (InvalidOperationException) - { } + { } return allCount; } } public int GetCount(int priority) { - int countInThisQoueu=0; + int countInThisQoueu = 0; try { foreach (PriorityQueue p in OurSetWhithData) @@ -188,13 +187,13 @@ public bool Contains(Tuple item) { throw new InvalidOperationException(); } - + return result; } public void CopyTo(Tuple[] array, int arrayIndex) { - int countOfArray=this.Count; + int countOfArray = this.Count; for (int i = arrayIndex; i < countOfArray; i++) { array[i] = new Tuple(1, this.Dequeue()); @@ -211,7 +210,7 @@ public bool Remove(Tuple item) bool isRemove = false; if (Contains(item)) { - + } return isRemove; @@ -250,20 +249,20 @@ System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() } } - /* class SortQueueByPriority : IComparer> - { + /* class SortQueueByPriority : IComparer> + { - public int Compare(PriorityQueue pq1, PriorityQueue pq2) - { - int resultOfCompare = 0; - if (pq1.Priority > pq2.Priority) - { resultOfCompare = 1; } - if (pq1.Priority < pq2.Priority) - { resultOfCompare = -1; } - return resultOfCompare; - } - - - }*/ + public int Compare(PriorityQueue pq1, PriorityQueue pq2) + { + int resultOfCompare = 0; + if (pq1.Priority > pq2.Priority) + { resultOfCompare = 1; } + if (pq1.Priority < pq2.Priority) + { resultOfCompare = -1; } + return resultOfCompare; + } + + + }*/ } diff --git a/Encapsulation/Encapsulation.csproj b/Encapsulation/Encapsulation.csproj index b05a217..3885fed 100644 --- a/Encapsulation/Encapsulation.csproj +++ b/Encapsulation/Encapsulation.csproj @@ -41,43 +41,20 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Encapsulation/IEncapsulationExercises.cs b/Encapsulation/IEncapsulationExercises.cs index 6b97690..5f602cd 100644 --- a/Encapsulation/IEncapsulationExercises.cs +++ b/Encapsulation/IEncapsulationExercises.cs @@ -11,7 +11,5 @@ interface IEncapsulationExercises void MoneyMoney(); void WorkPriorityQueue(); - - void WorkCollectionInheritedClasses(); } } diff --git a/Encapsulation/IPriorityQueue.cs b/Encapsulation/IPriorityQueue.cs index d714050..050ecdd 100644 --- a/Encapsulation/IPriorityQueue.cs +++ b/Encapsulation/IPriorityQueue.cs @@ -8,7 +8,6 @@ namespace Encapsulation { interface IPriorityQueue { - void Enqueue(T val, int priority); T Dequeue(); T First(); diff --git a/Encapsulation/Konstantin/ComplexNumber.cs b/Encapsulation/Konstantin/ComplexNumber.cs deleted file mode 100644 index 1ebf392..0000000 --- a/Encapsulation/Konstantin/ComplexNumber.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Konstantin -{ - class ComplexNumber - { - public double Real { get; private set;} - public double Imaginary { get; private set; } - public double Magnitude - { - get - { - return Math.Sqrt(Math.Pow(Real,2)+Math.Pow(Imaginary,2)); - } - } - - public ComplexNumber() { Real=0; Imaginary=0;} - - public ComplexNumber(double real, double imaginary) - { - Real=real; - Imaginary=imaginary; - } - - public static ComplexNumber operator+(ComplexNumber operand1, ComplexNumber operand2) - { - return new ComplexNumber(operand1.Real + operand2.Real, operand1.Imaginary + operand2.Imaginary); - } - - public static ComplexNumber operator -(ComplexNumber operand1, ComplexNumber operand2) - { - return new ComplexNumber(operand1.Real - operand2.Real, operand1.Imaginary - operand2.Imaginary); - } - - public static ComplexNumber operator *(ComplexNumber operand1, int multiplier) - { - return new ComplexNumber(operand1.Real *multiplier, operand1.Imaginary*multiplier); - } - - public static ComplexNumber operator *(ComplexNumber operand1, ComplexNumber operand2) - { - return new ComplexNumber((operand1.Real * operand2.Real-operand1.Imaginary*operand2.Imaginary), (operand1.Imaginary * operand2.Real+operand1.Imaginary*operand2.Imaginary)); - } - - public static ComplexNumber operator /(ComplexNumber operand1, ComplexNumber operand2) - { - - return new ComplexNumber((operand1.Real * operand2.Real + operand1.Imaginary * operand2.Imaginary) / (operand2.Imaginary * operand2.Imaginary + operand2.Real * operand2.Real), - (operand1.Imaginary*operand2.Real-operand1.Real*operand2.Imaginary)/ (operand2.Imaginary * operand2.Imaginary + operand2.Real * operand2.Real)); - } - - public static ComplexNumber operator /(ComplexNumber operand1, int divisor) - { - return new ComplexNumber(operand1.Real/divisor, operand1.Imaginary/divisor); - } - - public static bool operator ==(ComplexNumber operand1, ComplexNumber operand2) - { - return (operand1.Real == operand2.Real && operand1.Imaginary == operand2.Imaginary); - } - - public static bool operator !=(ComplexNumber operand1, ComplexNumber operand2) - { - return (operand1.Real != operand2.Real || operand1.Imaginary != operand2.Imaginary); - } - - public static implicit operator string(ComplexNumber operand1) - { - return String.Format("{0}+{1}i",operand1.Real,operand1.Imaginary); - } - public override string ToString() - { - return (string)this; - } - public static bool operator <(ComplexNumber operand1, ComplexNumber operand2) - { - return (operand1.Magnitude < operand2.Magnitude); - } - public static bool operator >(ComplexNumber operand1, ComplexNumber operand2) - { - return (operand1.Magnitude > operand2.Magnitude); - } - public static bool operator >=(ComplexNumber operand1, ComplexNumber operand2) - { - return (operand1.Magnitude >= operand2.Magnitude); - } - public static bool operator <=(ComplexNumber operand1, ComplexNumber operand2) - { - return (operand1.Magnitude < operand2.Magnitude); - } - } -} diff --git a/Encapsulation/Konstantin/EncapsulationExercises.cs b/Encapsulation/Konstantin/EncapsulationExercises.cs index 6020a4e..30a5508 100644 --- a/Encapsulation/Konstantin/EncapsulationExercises.cs +++ b/Encapsulation/Konstantin/EncapsulationExercises.cs @@ -10,18 +10,7 @@ class EncapsulationExercises : IEncapsulationExercises { public void MoneyMoney() { - Money m1 = new Money(); - Money m2 = new Money(25,51); - Money m3 = new Money(1024); - - int hrivnas = m1.Hrivnas; - int kopecks = m1.Kopecks; - - Money m4 = m1 + m3; - int totalKopecs = (int)m2; - float someMoney = (float)m2; - string moneyString = (string)m2; - string moneyString1 = m2.ToString(); + throw new NotImplementedException(); } @@ -29,25 +18,5 @@ public void WorkPriorityQueue() { throw new NotImplementedException(); } - - - public void WorkCollectionInheritedClasses() - { - MyDictionary studentsBase = new MyDictionary(); - - Student st1 = new Student() {firstName = "1", lastName = "2", birthDate = new DateTime(12,12,2012) }; - Tuple st1Key = new Tuple("1", "2", new DateTime(12, 12, 2012)); - - if (studentsBase.Contains(st1)) - { - studentsBase.Add(st1); - Student st1Copy = studentsBase[st1Key]; - } - else - { - Console.WriteLine("Student is not found"); - } - - } } } diff --git a/Encapsulation/Konstantin/Money.cs b/Encapsulation/Konstantin/Money.cs deleted file mode 100644 index 86aad5c..0000000 --- a/Encapsulation/Konstantin/Money.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Konstantin -{ - class Money - { - private int kopecks = 0; - - public int Kopecks { get { return kopecks % 100; } } - public int Hrivnas { get { return kopecks / 100; } } - - public Money() { } - public Money(int kopecks) - { - this.kopecks = kopecks; - } - public Money(int grivnas, int kopecks) - : this(kopecks) - { - this.kopecks += grivnas * 100; - } - - public static Money operator +(Money operand1, Money operand2) - { - return new Money(operand1.kopecks + operand2.kopecks); - } - public static Money operator -(Money operand1, Money operand2) - { - return new Money(operand1.kopecks - operand2.kopecks); - } - public static Money operator *(Money operand1, int operand2) - { - return new Money(operand1.kopecks * operand2); - } - public static Money operator /(Money operand1, int operand2) - { - return new Money(operand1.kopecks / operand2); - } - public static bool operator ==(Money operand1, Money operand2) - { - return (operand1.kopecks == operand2.kopecks); - } - public static bool operator !=(Money operand1, Money operand2) - { - return (operand1.kopecks != operand2.kopecks); - } - public static bool operator >(Money operand1, Money operand2) - { - return (operand1.kopecks > operand2.kopecks); - } - public static bool operator >=(Money operand1, Money operand2) - { - return (operand1.kopecks >= operand2.kopecks); - } - public static bool operator <(Money operand1, Money operand2) - { - return (operand1.kopecks < operand2.kopecks); - } - public static bool operator <=(Money operand1, Money operand2) - { - return (operand1.kopecks <= operand2.kopecks); ; - } - - public static implicit operator float(Money operand1) - { - return ((float)operand1.kopecks / 100); - } - - public static implicit operator int(Money operand1) - { - return operand1.kopecks; - } - - public static implicit operator string(Money operand1) - { - return String.Format("{0} hrivnas, {1} kopecks.", operand1.Hrivnas, operand1.Kopecks); - } - public override string ToString() - { - return (string)this; - } - } -} diff --git a/Encapsulation/Konstantin/MyDictionary.cs b/Encapsulation/Konstantin/MyDictionary.cs deleted file mode 100644 index b3fded6..0000000 --- a/Encapsulation/Konstantin/MyDictionary.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Collections.ObjectModel; - -namespace Encapsulation.Konstantin -{ - public struct Student - { - public string firstName, lastName; - public DateTime birthDate; - public int rating, personalCode; - } - class MyDictionary : KeyedCollection,Student> - { - protected override Tuple GetKeyForItem(Student item) - { - return new Tuple(item.firstName, item.lastName, item.birthDate); - } - } - class MyCollection : Collection - { - protected override void ClearItems() - { - base.ClearItems(); - Console.WriteLine("Collection is cleared"); - } - protected override void InsertItem(int index, Student item) - { - base.InsertItem(index, item); - Console.WriteLine("Item is inserted"); - } - protected override void RemoveItem(int index) - { - base.RemoveItem(index); - Console.WriteLine("Item is removed"); - } - protected override void SetItem(int index, Student item) - { - base.SetItem(index, item); - Console.WriteLine("Item is set"); - } - } -} diff --git a/Encapsulation/MatrixExample/MatrixExample.cs b/Encapsulation/MatrixExample/MatrixExample.cs deleted file mode 100644 index 546078a..0000000 --- a/Encapsulation/MatrixExample/MatrixExample.cs +++ /dev/null @@ -1,114 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.MatrixExample -{ - interface ICalculator - { - T Add(T op1, T op2); - T Substract(T op1, T op2); - // etc.... - } - - class IntCalculator : ICalculator - { - - public int Add(int op1, int op2) - { - return op1 + op2; - } - - public int Substract(int op1, int op2) - { - return op1 - op2; - } - } - - class Matrix where TCalc : ICalculator, new() - { - private T[,] data; - private readonly static ICalculator calculator = new TCalc(); - - public Matrix(int height, int width) - { - data = new T[height, width]; - } - - private void CheckIndex(int row, int col) - { - if (row >= data.GetLength(0) || col >= data.GetLength(1)) - { - throw new IndexOutOfRangeException("Matrix index problem"); - } - } - - public T this[int row, int col] - { - get - { - CheckIndex(row, col); - return data[row, col]; - } - set - { - CheckIndex(row, col); - data[row, col] = value; - } - } - - public static Matrix operator +(Matrix op1, Matrix op2) - { - int width1 = op1.data.GetLength(1); - int width2 = op2.data.GetLength(1); - int height1 = op1.data.GetLength(0); - int height2 = op2.data.GetLength(0); - if(width1 != width2 || height1 != height2) - { - throw new ApplicationException("Matrixes can not be added"); - } - Matrix ret = new Matrix(height1, width1); - for (int row = 0; row < height1; row++) - { - for (int col = 0; col < width1; col++) - { - ret[row, col] = calculator.Add(op1[row, col], op2[row, col]); - } - } - return ret; - } - - public override string ToString() - { - StringBuilder ret = new StringBuilder(); - ret.AppendLine(string.Format("Height: {0}\nWidth: {1}", data.GetLength(0), data.GetLength(1))); - for (int row = 0; row < data.GetLength(0); row++) - { - for (int col = 0; col < data.GetLength(1); col++) - { - ret.AppendFormat("\t{0}", data[row, col]); - } - ret.AppendLine(); - } - return ret.ToString(); - } - } - - class MatrixExample - { - public static void Do() - { - Matrix myMatrix1 = new Matrix(3, 4); - Matrix myMatrix2 = new Matrix(3, 4); - myMatrix1[1, 1] = 5; - myMatrix2[1, 1] = 5; - Matrix myMatrix3 = myMatrix1 + myMatrix2; - Console.WriteLine(myMatrix1); - Console.WriteLine(myMatrix2); - Console.WriteLine(myMatrix3); - Console.ReadKey(true); - } - } -} diff --git a/Encapsulation/Program.cs b/Encapsulation/Program.cs index e6bb0e9..fbf3637 100644 --- a/Encapsulation/Program.cs +++ b/Encapsulation/Program.cs @@ -33,19 +33,13 @@ static void Main(string[] args) case "Vladimir": exercises = new Vladimir.EncapsulationExercises(); break; - case "MatrixExample": - MatrixExample.MatrixExample.Do(); - break; default: - Console.WriteLine("Wrong argument. Choose one of: Alina, Andrey, Elena, Konstantin, Valeriya, Vladimir, MatrixExample"); + Console.WriteLine("Wrong argument. Choose one of: Alina, Andrey, Elena, Konstantin, Valeriya, Vladimir"); break; } if (exercises != null) { - exercises.MoneyMoney(); - exercises.WorkPriorityQueue(); - exercises.WorkCollectionInheritedClasses(); } } } diff --git a/Encapsulation/Valeriya/Double.cs b/Encapsulation/Valeriya/Double.cs deleted file mode 100644 index 46e69d9..0000000 --- a/Encapsulation/Valeriya/Double.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Valeriya -{ - class Double: Number - { - public override double Add(double oper) - { - return oper + value; - } - - } -} diff --git a/Encapsulation/Valeriya/EmptyQueueException.cs b/Encapsulation/Valeriya/EmptyQueueException.cs deleted file mode 100644 index 7e55cd9..0000000 --- a/Encapsulation/Valeriya/EmptyQueueException.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Valeriya -{ - class EmptyQueueException: ApplicationException - { - public EmptyQueueException(string msg) : base (msg) - { - } - } -} diff --git a/Encapsulation/Valeriya/EncapsulationExercises.cs b/Encapsulation/Valeriya/EncapsulationExercises.cs index bde8ac4..eb3a41d 100644 --- a/Encapsulation/Valeriya/EncapsulationExercises.cs +++ b/Encapsulation/Valeriya/EncapsulationExercises.cs @@ -1,105 +1,22 @@ using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace Encapsulation.Valeriya { class EncapsulationExercises : IEncapsulationExercises { - static Random rnd = new Random(); - - public static void PrintQueue(PriorityQueue queue) - { - for (int i = 0; i < queue.Count; i++) - { - Console.WriteLine(queue[i]); - } - } - - public void WorkPriorityQueue() - { - PriorityQueue intPriorityQueue = new PriorityQueue(); - int priorityTest; - int valueTest; - int inputIndexForTestLat; - int inputIndexForTestFirst; - int inputIndexForTestGetCount; - intPriorityQueue.Add(0, rnd.Next(1, 100)); - intPriorityQueue.Add(1, rnd.Next(1, 100)); - intPriorityQueue.Add(1, rnd.Next(1, 100)); - intPriorityQueue.Add(3, rnd.Next(1, 100)); - intPriorityQueue.Add(5, rnd.Next(1, 100)); - intPriorityQueue.Add(5, rnd.Next(1, 100)); - intPriorityQueue.Add(6, rnd.Next(1, 100)); - intPriorityQueue.Add(7, rnd.Next(1, 100)); - intPriorityQueue.Add(8, rnd.Next(1, 100)); - intPriorityQueue.Add(8, rnd.Next(1, 100)); - intPriorityQueue.Add(8, rnd.Next(1, 100)); - PrintQueue(intPriorityQueue); - - try - { - Console.WriteLine("Count of elems = {0}", intPriorityQueue.Count); - - Console.WriteLine("Enter priority to find last elem"); - Int32.TryParse(Console.ReadLine(), out inputIndexForTestLat); - Console.WriteLine("The last elem is {0}", intPriorityQueue.Last(inputIndexForTestLat)); - - Console.WriteLine("Enter priority to find first elem"); - Int32.TryParse(Console.ReadLine(), out inputIndexForTestFirst); - Console.WriteLine("The first elem is {0}", intPriorityQueue.First(inputIndexForTestFirst)); - - Console.WriteLine("Enter priority to find count elems"); - Int32.TryParse(Console.ReadLine(), out inputIndexForTestGetCount); - Console.WriteLine("Count of elems with priority {0} is {1}", inputIndexForTestGetCount, intPriorityQueue.GetCount(inputIndexForTestFirst)); - - Console.WriteLine("The element {0} dequeued", intPriorityQueue.Dequeue()); - PrintQueue(intPriorityQueue); - - Console.WriteLine("Enter the element to push"); - Int32.TryParse(Console.ReadLine(), out priorityTest); - Int32.TryParse(Console.ReadLine(), out valueTest); - intPriorityQueue.Enqueue(valueTest, priorityTest); - PrintQueue(intPriorityQueue); - } - catch (EmptyQueueException e) - { - Console.WriteLine("Error: The queue is empty", e.Message); - } - - Console.ReadKey(); - } - public void MoneyMoney() { - Money m = new Money(1018); - Money m1 = new Money(26,56); - Money m2 = new Money(1, 58); - Money m3 = m1 + m2; - //Console.WriteLine("string: {0}", m1.ToString()); - //Console.WriteLine("int: {0}", (int)m1); - //Console.WriteLine("float: {0}", (float)m1); - //Console.WriteLine(m3); - //Console.WriteLine("------------SquarredMatrix------------"); - SquarredMatrix matrix1 = new SquarredMatrix(3); - SquarredMatrix matrix2 = new SquarredMatrix(3); - SquarredMatrix matrix3 = matrix1 + matrix2; - SquarredMatrix.PrintMatrix(matrix1); - SquarredMatrix.PrintMatrix(matrix2); - SquarredMatrix.PrintMatrix(matrix3); - Console.ReadKey(); + throw new NotImplementedException(); } - public void WorkCollectionInheritedClasses() + public void WorkPriorityQueue() { - MyDictionary students = new MyDictionary(); - students.Add(new Student("Name", "Surname", new DateTime(2015, 9, 8), 100000000)); - Tuple key = Tuple.Create("Name", "Surname", new DateTime(2015, 9, 8), 100000000); - if (students.Contains(key)) - { - Console.WriteLine("Succeed"); - } - - Console.ReadKey(); + throw new NotImplementedException(); } } } diff --git a/Encapsulation/Valeriya/Int.cs b/Encapsulation/Valeriya/Int.cs deleted file mode 100644 index 9139977..0000000 --- a/Encapsulation/Valeriya/Int.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Valeriya -{ - class Int: Number - { - public override int Add(int oper) - { - return oper + value; - } - - } -} diff --git a/Encapsulation/Valeriya/Matrix.cs b/Encapsulation/Valeriya/Matrix.cs deleted file mode 100644 index 9f4eee4..0000000 --- a/Encapsulation/Valeriya/Matrix.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Valeriya -{ - class SquarredMatrix - { - static Random rnd = new Random(); - double[,] matrix = null; - public SquarredMatrix(int sizeOfMatrix) - { - matrix = new double[sizeOfMatrix, sizeOfMatrix]; - - for (int i = 0; i < sizeOfMatrix; i++) - { - for (int j = 0; j < sizeOfMatrix; j++) - { - matrix[i, j] = rnd.Next(-100, 100); - } - } - } - - public SquarredMatrix (double[,] matrixInArray) - { - matrix = matrixInArray; - } - - public SquarredMatrix() - { - matrix = new double[2, 2]; - matrix[0, 0] = 1; - matrix[0, 1] = 2; - matrix[1, 0] = 3; - matrix[1, 1] = 4; - } - - public double this[int row, int col] - { - get { return matrix[row, col]; } - set { matrix[row, col] = value; } - } - - public static double[,] MatrixToArray(SquarredMatrix inputMatrix) - { - double[,] result = new double[inputMatrix.SizeOfMatrix, inputMatrix.SizeOfMatrix]; - result = (double[,])inputMatrix.matrix.Clone(); - return result; - } - - public int SizeOfMatrix - { - get { return (int)(Math.Sqrt(matrix.Length)); } - } - - public static SquarredMatrix operator+ (SquarredMatrix operand1, SquarredMatrix operand2) - { - SquarredMatrix result = new SquarredMatrix(operand1.SizeOfMatrix); - - for (int i = 0; i < operand1.SizeOfMatrix; i++) - { - for (int j = 0; j < operand2.SizeOfMatrix; j++) - { - result[i, j] = operand1[i, j] + operand2[i, j]; - } - } - return result; - } - - public static SquarredMatrix operator- (SquarredMatrix operand1, SquarredMatrix operand2) - { - SquarredMatrix result = new SquarredMatrix(operand1.SizeOfMatrix); - - for (int i = 0; i < operand1.SizeOfMatrix; i++) - { - for (int j = 0; j < operand2.SizeOfMatrix; j++) - { - result[i, j] = operand1[i, j] - operand2[i, j]; - } - } - return result; - } - - public static SquarredMatrix MultiplyWithIdentityMatrix(SquarredMatrix inputMatrix) - { - SquarredMatrix result = new SquarredMatrix(inputMatrix.SizeOfMatrix); - //copy inputMatrix to result - return result; - } - - public static void PrintMatrix(SquarredMatrix operand) - { - for (int i = 0; i < operand.SizeOfMatrix; i++) - { - for (int j = 0; j < operand.SizeOfMatrix; j++) - { - Console.Write(operand[i,j] + " "); - } - Console.WriteLine("\n"); - } - - Console.WriteLine("------------------------------"); - } - - } - - class Matrix - { - static Random rnd = new Random(); - private T[,] internalData = null; - public Matrix(int width, int height) - { - internalData = new T[width, height]; - } - - - - - } -} diff --git a/Encapsulation/Valeriya/Money.cs b/Encapsulation/Valeriya/Money.cs deleted file mode 100644 index 5ff4210..0000000 --- a/Encapsulation/Valeriya/Money.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Valeriya -{ - class Money - { - private int kopeiky; - public int Hrivnas - { - get { return kopeiky / 100; } - } - public int Kopeyki - { - get { return kopeiky % 100; } - - } - public Money(int hrivnas, int kopeiky) - { - this.kopeiky = hrivnas * 100 + kopeiky; - } - - public Money(int kopeiky) - { - this.kopeiky = kopeiky; - } - public Money(): this(0) - { - } - - public static Money operator+ (Money operand1, Money operand2) - { - return new Money(operand1.kopeiky + operand2.kopeiky); - } - - public static Money operator* (Money operand1, int operand2) - { - return new Money(operand1.kopeiky * operand2); - } - - public static Money operator* (int operand1, Money operand2) - { - return new Money(operand2.kopeiky * operand1); - } - - public static Money operator- (Money operand1, Money operand2) - { - return new Money(operand1.kopeiky - operand2.kopeiky); - } - - public static Money operator/ (int operand1, Money operand2) - { - return new Money(operand2.kopeiky / operand1); - } - - public static bool operator!= (Money operand1, Money operand2) - { - return operand1.kopeiky != operand2.kopeiky; - } - - public static bool operator== (Money operand1, Money operand2) - { - return operand1.kopeiky == operand2.kopeiky; - } - - public static bool operator> (Money operand1, Money operand2) - { - return operand1.kopeiky > operand2.kopeiky; - } - - public static bool operator< (Money operand1, Money operand2) - { - return operand1.kopeiky < operand2.kopeiky; - } - - public static bool operator>= (Money operand1, Money operand2) - { - return operand1.kopeiky >= operand2.kopeiky; - } - - public static bool operator<= (Money operand1, Money operand2) - { - return operand1.Kopeyki <= operand2.Kopeyki; - } - - public override string ToString() - { - return string.Format("Your sum is {0} kopecs", kopeiky); - } - - public static explicit operator int (Money operand) - { - int kopecs = operand.kopeiky; - return kopecs; - } - - public static explicit operator float (Money operand) - { - float kopecs = operand.kopeiky; - return kopecs; - } - } -} diff --git a/Encapsulation/Valeriya/MyCollection.cs b/Encapsulation/Valeriya/MyCollection.cs deleted file mode 100644 index ab16a0e..0000000 --- a/Encapsulation/Valeriya/MyCollection.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Collections.ObjectModel; - -namespace Encapsulation.Valeriya -{ - class MyCollection: Collection - { - protected override void ClearItems() - { - base.ClearItems(); - Console.WriteLine("Cleared"); - } - - protected override void RemoveItem(int index) - { - base.RemoveItem(index); - Console.WriteLine("Item removed"); - } - - protected override void InsertItem(int index, T item) - { - base.InsertItem(index, item); - Console.WriteLine("Item inserted"); - } - - protected override void SetItem(int index, T item) - { - base.SetItem(index, item); - Console.WriteLine("Item replaced"); - } - } -} diff --git a/Encapsulation/Valeriya/MyDictionary.cs b/Encapsulation/Valeriya/MyDictionary.cs deleted file mode 100644 index 559b22b..0000000 --- a/Encapsulation/Valeriya/MyDictionary.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Collections.ObjectModel; - -namespace Encapsulation.Valeriya -{ - class MyDictionary: KeyedCollection, Student> - { - protected override Tuple GetKeyForItem(Student item) - { - return Tuple.Create(item.firstName, item.fastName, item.dateOfBirth, item.personalCode); - } - - protected override void ClearItems() - { - base.ClearItems(); - Console.WriteLine("Cleared"); - } - - protected override void InsertItem(int index, Student item) - { - base.InsertItem(index, item); - Console.WriteLine("Item inserted"); - } - - protected override void RemoveItem(int index) - { - base.RemoveItem(index); - Console.WriteLine("Item removed"); - } - - protected override void SetItem(int index, Student item) - { - base.SetItem(index, item); - Console.WriteLine("Item replaced"); - } - } -} diff --git a/Encapsulation/Valeriya/Number.cs b/Encapsulation/Valeriya/Number.cs deleted file mode 100644 index 82590ce..0000000 --- a/Encapsulation/Valeriya/Number.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Valeriya -{ - abstract class Number - { - protected T value; - - public Number(){} - - public Number(T val) - { - value = val; - } - - abstract public T Add(T op1); - } -} diff --git a/Encapsulation/Valeriya/PriorityQueue.cs b/Encapsulation/Valeriya/PriorityQueue.cs deleted file mode 100644 index 756a55a..0000000 --- a/Encapsulation/Valeriya/PriorityQueue.cs +++ /dev/null @@ -1,172 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Valeriya -{ - class PriorityQueue : Encapsulation.IPriorityQueue , ICollection> - { - List> priorityQueue; - - public PriorityQueue() - { - priorityQueue = new List>(); - } - - public Tuple this[int elem] - { - get { return priorityQueue[elem]; } - set { priorityQueue[elem] = value; } - } - - public void Add(int priority, T value) - { - priorityQueue.Add(Tuple.Create(priority, value)); - } - - public int Count - { - get { return priorityQueue.Count; } - } - - public T Dequeue() - { - T result = GetHighestPriorityElem().Item2; - - if (priorityQueue.Count == 0) - { - throw new EmptyQueueException("The queue is empty"); - } - - return result; - } - - public void Enqueue(T val, int priority) - { - int index = 0; - for (int i = 0; i < priorityQueue.Count; i++) - { - if (priorityQueue[i].Item1 > priority) - { - index = i; - break; - } - } - - priorityQueue.Insert(index, Tuple.Create(priority, val)); - } - - public T First() - { - return priorityQueue[0].Item2; - } - - public T First(int priority) - { - T result = priorityQueue[0].Item2; - for (int i = 0; i < priorityQueue.Count; i++) - { - if (priorityQueue[i].Item1 == priority) - { - result = priorityQueue[i].Item2; - break; - } - } - - return result; - } - - public int GetCount(int priority) - { - int count = 0; - for (int i = 0; i < priorityQueue.Count; i++) - { - if (priorityQueue[i].Item1 == priority) - { - count++; - } - } - - return count; - } - - public T Last() - { - return priorityQueue[priorityQueue.Count - 1].Item2; - } - - public T Last(int priority) - { - T result = priorityQueue[0].Item2; - for (int i = priorityQueue.Count - 1; i >= 0; i--) - { - if (priorityQueue[i].Item1 == priority) - { - result = priorityQueue[i].Item2; - break; - } - } - - return result; - } - - Tuple GetHighestPriorityElem() - { - Tuple minElemInQueue = priorityQueue[0]; - for (int i = 0; i < priorityQueue.Count; i++) - { - if (priorityQueue[i].Item1 < minElemInQueue.Item1) - { - minElemInQueue = priorityQueue[i]; - } - } - - return minElemInQueue; - } - - - - public void Add(Tuple item) - { - priorityQueue.Add(item); - } - - public void Clear() - { - priorityQueue.Clear(); - } - - public bool Contains(Tuple item) - { - return priorityQueue.Contains(item); - } - - public void CopyTo(Tuple[] array, int arrayIndex) - { - priorityQueue.CopyTo(array, arrayIndex); - } - - public bool IsReadOnly - { - get; - } - - public bool Remove(Tuple item) - { - return priorityQueue.Remove(item); - } - - public IEnumerator> GetEnumerator() - { - foreach (Tuple item in priorityQueue) - yield return item; - } - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return this.GetEnumerator(); - } - } -} diff --git a/Encapsulation/Valeriya/Student.cs b/Encapsulation/Valeriya/Student.cs deleted file mode 100644 index 9a5b42b..0000000 --- a/Encapsulation/Valeriya/Student.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Encapsulation.Valeriya -{ - public class Student - { - public string firstName; - public string fastName; - public DateTime dateOfBirth; - DateTime applicationTime; - int Rating; - public int personalCode; - - public Student(string firstName, string lastName, DateTime birthDate, int personalCode) - { - this.firstName = firstName; - this.fastName = lastName; - this.dateOfBirth = birthDate; - this.personalCode = personalCode; - } - } -} diff --git a/Encapsulation/Vladimir/EncapsulationExercises.cs b/Encapsulation/Vladimir/EncapsulationExercises.cs index 767448f..edd4cef 100644 --- a/Encapsulation/Vladimir/EncapsulationExercises.cs +++ b/Encapsulation/Vladimir/EncapsulationExercises.cs @@ -20,11 +20,5 @@ public void MoneyMoney() { throw new NotImplementedException(); } - - - public void WorkCollectionInheritedClasses() - { - throw new NotImplementedException(); - } } } diff --git a/Miner/IMinerGame.cs b/Miner/IMinerGame.cs index dc094dd..2a7fb90 100644 --- a/Miner/IMinerGame.cs +++ b/Miner/IMinerGame.cs @@ -9,7 +9,6 @@ namespace Miner enum CellStatus { NotOpened = -1, Empty = 0, - /*don't change the order*/ OneAround, TwoAround, ThreeAround, FourAround, FiveAround, SixAround, SevenAround, EightAround, HasMine = 100 } @@ -42,9 +41,6 @@ interface IMinerGame /// status of cell (not opened, empty, has mine, does not have mine but has some mines around) CellStatus this[int row, int col] { get; } - - - int Width { get; } int Height { get; } } diff --git a/Miner/Miner.csproj b/Miner/Miner.csproj index 7ea645e..c377b2b 100644 --- a/Miner/Miner.csproj +++ b/Miner/Miner.csproj @@ -53,7 +53,6 @@ - diff --git a/Miner/Program.cs b/Miner/Program.cs index b93191a..e991914 100644 --- a/Miner/Program.cs +++ b/Miner/Program.cs @@ -72,12 +72,11 @@ static void Main(string[] args) } catch (Exception e) { - Console.WriteLine(e); + Console.WriteLine("Something was wrong with {0}", factory.ToString()); } Console.WriteLine("Factory {0} done.", factory.ToString()); } } // args - Console.ReadKey(); } static void Assert(bool condition, string message) diff --git a/Miner/Valeriya/GameCell.cs b/Miner/Valeriya/GameCell.cs deleted file mode 100644 index 4f2fe58..0000000 --- a/Miner/Valeriya/GameCell.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Miner.Valeriya -{ - class GameCell - { - public bool IsOpened { get; set; } - public bool IsEmpty { get; set; } - public int CountOfBombsAround{ get; set; } - - public GameCell(bool isEmpty, bool isOpened) - { - IsEmpty = isEmpty; - IsOpened = isOpened; - CountOfBombsAround = 0; - } - - - } -} diff --git a/Miner/Valeriya/MinerGame.cs b/Miner/Valeriya/MinerGame.cs index 8015e31..28b0cdc 100644 --- a/Miner/Valeriya/MinerGame.cs +++ b/Miner/Valeriya/MinerGame.cs @@ -6,220 +6,52 @@ namespace Miner.Valeriya { - class MinerGame : IMinerGame { - private bool isGameEmpty; - private bool isGameStarted = false; - private bool isGameLost; - private bool isGameWon; - int gameFieldWidth = 0; - int gameFieldHeight = 0; - int countOfOpenedCells = 0; - int countOfSetBombs = 0; - static Random rand = new Random(); - GameCell[,] gameField; - public MinerGame (int rowNumber, int collNumber) - { - isGameEmpty = true; - gameField = new GameCell[rowNumber, collNumber]; - for (int i = 0; i < rowNumber; i++) - { - for (int j = 0; j < collNumber; j++) - { - gameField[i,j] = new GameCell(isEmpty: true, isOpened: false); - } - } - gameFieldWidth = collNumber; - gameFieldHeight = rowNumber; - } - - public MinerGame (int rowNumber, int collNumber, int countOfBombs) - { - isGameEmpty = false; - gameField = new GameCell[rowNumber,collNumber]; - for (int i = 0; i < rowNumber; i++) - { - for (int j = 0; j < collNumber; j++) - { - gameField[i, j] = new GameCell(isEmpty: true, isOpened: false); - } - } - gameFieldWidth = rowNumber; - gameFieldHeight = collNumber; - while (countOfBombs != 0) - { - int i = rand.Next(0, rowNumber); - int j = rand.Next(0, collNumber); - if (SetBomb(i, j)) - { - countOfBombs--; - } - } - } - public bool SetBomb(int row, int col) { - bool bombIsSet = false; - if (IsCellWithinField(row, col) && gameField[row, col].IsEmpty && !isGameStarted && !gameField[row, col].IsOpened) - { - gameField[row,col].IsEmpty = false; - if (IsCellWithinField(row - 1, col - 1) && col - 1 < Width && gameField[row - 1,col - 1].IsEmpty) - { - gameField[row - 1, col - 1].CountOfBombsAround++; - } - if (IsCellWithinField(row - 1, col) && gameField[row - 1, col].IsEmpty) - { - gameField[row - 1, col].CountOfBombsAround++; - } - if (IsCellWithinField(row - 1, col + 1) && gameField[row - 1, col + 1].IsEmpty) - { - gameField[row - 1, col + 1].CountOfBombsAround++; - } - if (IsCellWithinField(row, col - 1) && gameField[row, col - 1].IsEmpty) - { - gameField[row, col - 1].CountOfBombsAround++; - } - if (IsCellWithinField(row, col + 1) && gameField[row, col + 1].IsEmpty) - { - gameField[row, col + 1].CountOfBombsAround++; - } - if (IsCellWithinField(row + 1, col - 1) && gameField[row, col].IsEmpty) - { - gameField[row + 1, col - 1].CountOfBombsAround++; - } - if (IsCellWithinField(row + 1, col) && gameField[row + 1, col].IsEmpty) - { - gameField[row + 1, col].CountOfBombsAround++; - } - if (IsCellWithinField(row + 1, col + 1) && gameField[row + 1, col + 1].IsEmpty) - { - gameField[row + 1, col + 1].CountOfBombsAround++; - } - bombIsSet = true; - countOfSetBombs++; - } - - return bombIsSet; + throw new NotImplementedException(); } public bool IsGameStarted { - get { return isGameStarted; } + get { throw new NotImplementedException(); } } public void Start() { - isGameStarted = true; + throw new NotImplementedException(); } public bool Win { - get - { - if (gameField.Length - countOfOpenedCells == countOfSetBombs) - { - isGameWon = true; - } - - return isGameWon; - } + get { throw new NotImplementedException(); } } public bool Lose { - get { return isGameLost; } + get { throw new NotImplementedException(); } } public bool OpenCell(int row, int col) { - if (IsCellWithinField(row, col) && !gameField[row, col].IsOpened && isGameStarted) - { - if (!gameField[row, col].IsEmpty) - { - isGameLost = true; - } - gameField[row, col].IsOpened = true; - countOfOpenedCells++; - } - - return gameField[row, col].IsOpened; + throw new NotImplementedException(); } public CellStatus this[int row, int col] { - get { - CellStatus statusOfCell = 0; - if (gameField[row, col].IsEmpty) - { - statusOfCell = CellStatus.Empty; - } - else if (!gameField[row, col].IsEmpty && !gameField[row,col].IsOpened) - { - statusOfCell = CellStatus.HasMine; - } - else if (!gameField[row, col].IsOpened) - { - statusOfCell = CellStatus.NotOpened; - } - if (gameField[row, col].CountOfBombsAround == 1) - { - statusOfCell = CellStatus.OneAround; - } - if (gameField[row, col].CountOfBombsAround == 2) - { - statusOfCell = CellStatus.TwoAround; - } - if (gameField[row, col].CountOfBombsAround == 3) - { - statusOfCell = CellStatus.ThreeAround; - } - if (gameField[row, col].CountOfBombsAround == 4) - { - statusOfCell = CellStatus.FourAround; - } - if (gameField[row, col].CountOfBombsAround == 5) - { - statusOfCell = CellStatus.FiveAround; - } - if (gameField[row, col].CountOfBombsAround == 6) - { - statusOfCell = CellStatus.SixAround; - } - if (gameField[row, col].CountOfBombsAround == 7) - { - statusOfCell = CellStatus.SevenAround; - } - if (gameField[row, col].CountOfBombsAround == 8) - { - statusOfCell = CellStatus.EightAround; - } - return statusOfCell; - } + get { throw new NotImplementedException(); } } - bool IsCellWithinField (int row, int col) - { - bool isCellInField = false; - if (row >= 0 && row < Width && col >= 0 && col < Height) - { - isCellInField = true; - } - - return isCellInField; - } public int Width { - get { return gameFieldWidth; } + get { throw new NotImplementedException(); } } public int Height { - get { return gameFieldHeight; } + get { throw new NotImplementedException(); } } - - - } } diff --git a/Miner/Valeriya/MinerGameFactory.cs b/Miner/Valeriya/MinerGameFactory.cs index 2543666..6dd8c10 100644 --- a/Miner/Valeriya/MinerGameFactory.cs +++ b/Miner/Valeriya/MinerGameFactory.cs @@ -10,64 +10,23 @@ class MinerGameFactory : IMinerGameFactory { public IMinerGame NewEmptyGame(string playerName, Tuple rowsCols) { - MinerGame NewEmptyGame = new MinerGame(rowsCols.Item1, rowsCols.Item2); - return NewEmptyGame; + throw new NotImplementedException(); } public IMinerGame NewRandomGame(string playerName, Tuple rowsCols, int bombs) { - MinerGame NewRandomGame = new MinerGame(rowsCols.Item1, rowsCols.Item2, bombs); - return NewRandomGame; + throw new NotImplementedException(); } internal void Test() { - int Width = 0; - int Height = 0; - int bombs = 0; - int currRow = 0; - int currCol = 0; - Console.WriteLine("Hello, I'm a Miner game, please, choose type of game:\nFor Empty game type 0\nFor Random game type 1"); - string typeOfGame = Console.ReadLine(); - Console.WriteLine("Please, enter your name"); - string playerName = Console.ReadLine(); - Console.WriteLine("Please, enter field Width = "); - Int32.TryParse(Console.ReadLine(), out Width); - Console.WriteLine("Please, enter field Height = "); - Int32.TryParse(Console.ReadLine(), out Height); - - switch (typeOfGame) - { - case "0": - IMinerGame emptyGame = NewEmptyGame(playerName, new Tuple(Width, Height)); - break; - case "1": - Console.WriteLine("Please, specify number of bombs on the field"); - Int32.TryParse(Console.ReadLine(), out bombs); - IMinerGame randomGame = NewRandomGame(playerName, new Tuple(Width, Height), bombs); - randomGame.Start(); - while (!randomGame.Win && !randomGame.Lose) - { - Console.WriteLine("Choose a cell to open (enter row, that collum)"); - Int32.TryParse(Console.ReadLine(), out currRow); - Int32.TryParse(Console.ReadLine(), out currCol); - randomGame.OpenCell(currRow, currCol); - } - if (randomGame.Win) - { - Console.WriteLine("{0} the Victory is yours!", playerName); - } - else - { - Console.WriteLine("Game over:("); - } - break; - } + throw new NotImplementedException(); } + void IMinerGameFactory.Test() { throw new NotImplementedException(); } } -} \ No newline at end of file +} diff --git a/Miner/Vladimir/MinerGame.cs b/Miner/Vladimir/MinerGame.cs index 9cb0f22..0fde14f 100644 --- a/Miner/Vladimir/MinerGame.cs +++ b/Miner/Vladimir/MinerGame.cs @@ -10,205 +10,48 @@ class MinerGame : IMinerGame { public bool SetBomb(int row, int col) { - bool answer = false; - if ((row < Height && col < Width) && (row >= 0 && col >= 0) && canMakeBomb) - { - if (!poleGame[row][col].yesOrNoBomb) - { - countBomb++; - } - - poleGame[row][col].yesOrNoBomb = true; - answer = true; - } - return answer; + throw new NotImplementedException(); } public bool IsGameStarted { - get { return isStartedGame; } + get { throw new NotImplementedException(); } } public void Start() { - WeightCells(); - canMakeBomb = false; - isStartedGame = true; + throw new NotImplementedException(); } public bool Win { - get { return win; } + get { throw new NotImplementedException(); } } public bool Lose { - get { return lose; } + get { throw new NotImplementedException(); } } public bool OpenCell(int row, int col) { - bool answer = false; - if ((row < Height && col < Width) && (row >= 0 && col >= 0) && isStartedGame) - { - poleGame[row][col].openCell = true; - checkWin(); - - if (poleGame[row][col].yesOrNoBomb) - { - lose = true; - } - answer = true; - } - return answer; - } - - private void checkWin() - { - int countCells = 0; - for (int i = 0; i < height; i++) - { - for (int j = 0; j < width; j++) - { - if (poleGame[i][j].openCell && !poleGame[i][j].yesOrNoBomb) - { - countCells++; - } - } - } - win = (countCells == width*height-countBomb); + throw new NotImplementedException(); } - public CellStatus this[int row, int col] { - get - { - CellStatus answer = CellStatus.NotOpened; - if (!IsGameStarted || poleGame[row][col].openCell) - { - if (poleGame[row][col].yesOrNoBomb) - { - answer = CellStatus.HasMine; - } - else - { - answer = (CellStatus)poleGame[row][col].weightCells; - } - } - - return answer; - } + get { throw new NotImplementedException(); } } + public int Width { - get { return width; } + get { throw new NotImplementedException(); } } public int Height { - get { return height; } - } - - // ------------- объявление структур и переменных ------------------------------ - private bool isStartedGame = false; - private bool canMakeBomb = true; - private bool win = false; - private bool lose = false; - private int countBomb = 0; - - private struct CellsGame - { - public bool yesOrNoBomb; // наличие вомбы в клетке T/F - public int weightCells; // вес клетки (по количеству бомб в соседних клетках) - public bool flagOfPlayer; // наличие флага игрока в клетке T/F - public bool qгestionOfPlayer; // наличие вопроса игрока в клетке T/F - public bool openCell; // признак Открыта/Закрыта клетка - } - - public bool OpenStatus (int row, int col) - { - return poleGame[row][col].openCell; - } - - public void SetCanMakeBomb(bool inCanMakeBomb) - { - if (!IsGameStarted) - { - canMakeBomb = inCanMakeBomb; - } + get { throw new NotImplementedException(); } } - - public int CountBomb - { - get { return countBomb; } - } - - private int height, width; - private CellsGame[][] poleGame; - - public MinerGame(Tuple rowsCols) - { - height = rowsCols.Item1; // height = rowsCols.Item2; под старый тест мастера - width = rowsCols.Item2; // width = rowsCols.Item1; под старый тест мастера - - poleGame = new CellsGame[Height][]; // poleGame = new CellsGame[Width][]; под старый тест мастера - - for (int i = 0; i < Height; i++) // for (int i = 0; i < Width ; i++) под старый тест мастера - { - poleGame[i] = new CellsGame[Width]; // poleGame[i] = new CellsGame[Height]; под старый тест мастера - for (int j = 0; j < Width; j++) // for (int j = 0; j < Height; j++) под старый тест мастера - { - poleGame[i][j].yesOrNoBomb = false; - poleGame[i][j].weightCells = 0; - poleGame[i][j].flagOfPlayer = false; - poleGame[i][j].qгestionOfPlayer = false; - poleGame[i][j].openCell = false; - } - } - } - - //------------------------подсчет веса клетки-------------------------------- - private void WeightCells() - { - // Создание и инициализация массива с нулевыми первыми и последними строками и солбцами - int[][] workArray = new int[poleGame.Length + 2][]; - int secondIndex = poleGame[0].Length; - - for (int i = 0; i < poleGame.Length + 2; i++) - { - workArray[i] = new int[secondIndex + 2]; - } - - // Подсчет весов ячеек входного массива (вес ячейки = сумма количества бомб в окружающих ячейках) - // Заливка значений входного массива в массив, в котором значения 1-й, последней строки и столбы = 0 - for (int i = 0; i < poleGame.Length; i++) - { - for (int j = 0; j < poleGame[i].Length; j++) - { - workArray[i + 1][j + 1] = poleGame[i][j].yesOrNoBomb ? 1 : 0; - } - } - // Посчет весов ячеек входного массива (вес ячейки = количества бомб в окружающих ячейках) - int indexI = 1; - for (int i = 0; i < poleGame.Length; i++) - { - int indexJ = 1; - for (int j = 0; j < poleGame[i].Length; j++) - { - poleGame[i][j].weightCells = workArray[indexI - 1][indexJ - 1] + workArray[indexI - 1][indexJ] + workArray[indexI - 1][indexJ + 1] + - workArray[indexI][indexJ - 1] + workArray[indexI][indexJ + 1] + - workArray[indexI + 1][indexJ - 1] + workArray[indexI + 1][indexJ] + workArray[indexI + 1][indexJ + 1]; - indexJ++; - } - indexI++; - } - - - } - - //------------------------ - } } diff --git a/Miner/Vladimir/MinerGameFactory.cs b/Miner/Vladimir/MinerGameFactory.cs index 8ef5054..351833f 100644 --- a/Miner/Vladimir/MinerGameFactory.cs +++ b/Miner/Vladimir/MinerGameFactory.cs @@ -10,114 +10,23 @@ class MinerGameFactory : IMinerGameFactory { public IMinerGame NewEmptyGame(string playerName, Tuple rowsCols) { - MinerGame game = new MinerGame(rowsCols); - return game; + throw new NotImplementedException(); } public IMinerGame NewRandomGame(string playerName, Tuple rowsCols, int bombs) { - MinerGame game = new MinerGame(rowsCols); - - // установка бомб - Random rand = new Random(); - while (game.CountBomb < bombs) - { - game.SetBomb(rand.Next(0, rowsCols.Item1 - 1), rand.Next(0, rowsCols.Item2 - 1)); - } - game.SetCanMakeBomb(false); - - return game; + throw new NotImplementedException(); } internal void Test() { - do - { - int row = 5; // размеры поля row = 5; - int col = 4; // col = 4; - int i = 0; // координаты открываемой клетки - int j = 0; - - IMinerGame game = NewRandomGame("Vladimir", new Tuple(row, col), 8); - game.Start(); - - Console.Clear(); - Console.SetCursorPosition(0, 0); - - do - { - Console.Write("Введите, пожалуйста, координату I (целое число от 1 до {0}): ", row); - while (!int.TryParse(Console.ReadLine(), out i) || i > row || i<1) - { - Console.Write("Попробуйте еще раз. Число должно быть целым от 1 до (включительно) {0}: ", row); - } - - Console.Write("Введите, пожалуйста, координату J (целое число от 1 до {0}): ", col); - while (!int.TryParse(Console.ReadLine(), out j) || j > col || j < 1) - { - Console.Write("Попробуйте еще раз. Число должно быть целым от 1 до (включительно) {0}: ", col); - } - - game.OpenCell(i-1,j-1); - - PrintPole(game); - } - while (game.Win != true && game.Lose != true); - if (game.Win) - { - Console.WriteLine("Будьте здоровы! Вы выиграли!"); - } - else if (game.Lose) - { - Console.WriteLine("Попробуйте снова. Увы, этот сет Вы проиграли"); - } - - Console.WriteLine("Для выхода нажмите Escape; для продолжения - любую другую клавишу"); - } - while (Console.ReadKey().Key != ConsoleKey.Escape); + throw new NotImplementedException(); } - void PrintPole(IMinerGame game) - { - for (int poleRow = 0; poleRow < game.Height; poleRow++) - { - for (int poleCol = 0; poleCol < game.Width; poleCol++) - { - switch (game[poleRow, poleCol]) - { - case CellStatus.NotOpened: Console.Write("-"); - break; - case CellStatus.Empty: Console.Write("0"); // открывать все с нулевым весом! - break; - case CellStatus.OneAround: Console.Write("1"); - break; - case CellStatus.TwoAround: Console.Write("2"); - break; - case CellStatus.ThreeAround: Console.Write("3"); - break; - case CellStatus.FourAround: Console.Write("4"); - break; - case CellStatus.FiveAround: Console.Write("5"); - break; - case CellStatus.SixAround: Console.Write("6"); - break; - case CellStatus.SevenAround: Console.Write("7"); - break; - case CellStatus.EightAround: Console.Write("8"); - break; - case CellStatus.HasMine: Console.Write("M"); - break; - default: Console.Write("что-то не то"); - break; - } - } Console.WriteLine(); - } - } void IMinerGameFactory.Test() { throw new NotImplementedException(); } - - } + } } diff --git a/VeterinaryAlina/App.config b/VeterinaryAlina/App.config deleted file mode 100644 index 8e15646..0000000 --- a/VeterinaryAlina/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/VeterinaryAlina/Program.cs b/VeterinaryAlina/Program.cs deleted file mode 100644 index c275eb4..0000000 --- a/VeterinaryAlina/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace VeterinaryAlina -{ - class Program - { - static void Main(string[] args) - { - } - } -} diff --git a/VeterinaryAlina/Properties/AssemblyInfo.cs b/VeterinaryAlina/Properties/AssemblyInfo.cs deleted file mode 100644 index c3209c9..0000000 --- a/VeterinaryAlina/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("VeterinaryAlina")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("VeterinaryAlina")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("54303dbb-11ad-47f0-bb76-f595e9c1b181")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VeterinaryAlina/VeterinaryAlina.csproj b/VeterinaryAlina/VeterinaryAlina.csproj deleted file mode 100644 index 0eb6b56..0000000 --- a/VeterinaryAlina/VeterinaryAlina.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - AnyCPU - {86A66320-1CF7-4439-946E-399A2E30E580} - Exe - Properties - VeterinaryAlina - VeterinaryAlina - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VeterinaryElena/App.config b/VeterinaryElena/App.config deleted file mode 100644 index 8e15646..0000000 --- a/VeterinaryElena/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/VeterinaryElena/Program.cs b/VeterinaryElena/Program.cs deleted file mode 100644 index 502ec8f..0000000 --- a/VeterinaryElena/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace VeterinaryElena -{ - class Program - { - static void Main(string[] args) - { - } - } -} diff --git a/VeterinaryElena/Properties/AssemblyInfo.cs b/VeterinaryElena/Properties/AssemblyInfo.cs deleted file mode 100644 index 668c054..0000000 --- a/VeterinaryElena/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("VeterinaryElena")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("VeterinaryElena")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("db34d1dd-cd9c-4fb2-b933-f82ee164696d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VeterinaryElena/VeterinaryElena.csproj b/VeterinaryElena/VeterinaryElena.csproj deleted file mode 100644 index 2845676..0000000 --- a/VeterinaryElena/VeterinaryElena.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - AnyCPU - {883BE9B6-9577-4261-9C62-3A637471ED12} - Exe - Properties - VeterinaryElena - VeterinaryElena - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VeterinaryKonstantin/App.config b/VeterinaryKonstantin/App.config deleted file mode 100644 index 8e15646..0000000 --- a/VeterinaryKonstantin/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/VeterinaryKonstantin/Program.cs b/VeterinaryKonstantin/Program.cs deleted file mode 100644 index 220e5ac..0000000 --- a/VeterinaryKonstantin/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace VeterinaryKonstantin -{ - class Program - { - static void Main(string[] args) - { - } - } -} diff --git a/VeterinaryKonstantin/Properties/AssemblyInfo.cs b/VeterinaryKonstantin/Properties/AssemblyInfo.cs deleted file mode 100644 index 5321b57..0000000 --- a/VeterinaryKonstantin/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("VeterinaryKonstantin")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("VeterinaryKonstantin")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f776bb77-0a9b-4d3b-83de-afdb949c3716")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VeterinaryKonstantin/VeterinaryKonstantin.csproj b/VeterinaryKonstantin/VeterinaryKonstantin.csproj deleted file mode 100644 index d9146fc..0000000 --- a/VeterinaryKonstantin/VeterinaryKonstantin.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - AnyCPU - {F2FD6890-FA1E-4D3B-A267-7CF9BE8AC499} - Exe - Properties - VeterinaryKonstantin - VeterinaryKonstantin - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VeterinaryValeriya/App.config b/VeterinaryValeriya/App.config deleted file mode 100644 index 8e15646..0000000 --- a/VeterinaryValeriya/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/VeterinaryValeriya/Program.cs b/VeterinaryValeriya/Program.cs deleted file mode 100644 index 06593d0..0000000 --- a/VeterinaryValeriya/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace VeterinaryValeriya -{ - class Program - { - static void Main(string[] args) - { - } - } -} diff --git a/VeterinaryValeriya/Properties/AssemblyInfo.cs b/VeterinaryValeriya/Properties/AssemblyInfo.cs deleted file mode 100644 index 6f88a99..0000000 --- a/VeterinaryValeriya/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("VeterinaryValeriya")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("VeterinaryValeriya")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("55cfdc7d-d03a-456e-907d-c10a41e94aca")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VeterinaryValeriya/VeterinaryValeriya.csproj b/VeterinaryValeriya/VeterinaryValeriya.csproj deleted file mode 100644 index 055e2b6..0000000 --- a/VeterinaryValeriya/VeterinaryValeriya.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - AnyCPU - {69D21967-2A6D-4AAA-BAC8-DB15E7F26110} - Exe - Properties - VeterinaryValeriya - VeterinaryValeriya - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/VeterinaryVladimir/App.config b/VeterinaryVladimir/App.config deleted file mode 100644 index 8e15646..0000000 --- a/VeterinaryVladimir/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/VeterinaryVladimir/Program.cs b/VeterinaryVladimir/Program.cs deleted file mode 100644 index bd8c474..0000000 --- a/VeterinaryVladimir/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace VeterinaryVladimir -{ - class Program - { - static void Main(string[] args) - { - } - } -} diff --git a/VeterinaryVladimir/Properties/AssemblyInfo.cs b/VeterinaryVladimir/Properties/AssemblyInfo.cs deleted file mode 100644 index 96939bf..0000000 --- a/VeterinaryVladimir/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("VeterinaryVladimir")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("VeterinaryVladimir")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("cc485261-17e7-4c84-b4c5-2841409cc425")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VeterinaryVladimir/VeterinaryVladimir.csproj b/VeterinaryVladimir/VeterinaryVladimir.csproj deleted file mode 100644 index 45e7aa9..0000000 --- a/VeterinaryVladimir/VeterinaryVladimir.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - - Debug - AnyCPU - {76C9C915-3485-4158-B0CC-A3C6A9D0FAD2} - Exe - Properties - VeterinaryVladimir - VeterinaryVladimir - v4.5 - 512 - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tasks_cs2.sln b/tasks_cs2.sln index 2f7608e..65a7ab8 100644 --- a/tasks_cs2.sln +++ b/tasks_cs2.sln @@ -16,16 +16,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Collections", "Collections\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Encapsulation", "Encapsulation\Encapsulation.csproj", "{0B86DA56-DD67-4418-A8A4-9A6E058EC444}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VeterinaryVladimir", "VeterinaryVladimir\VeterinaryVladimir.csproj", "{76C9C915-3485-4158-B0CC-A3C6A9D0FAD2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VeterinaryElena", "VeterinaryElena\VeterinaryElena.csproj", "{883BE9B6-9577-4261-9C62-3A637471ED12}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VeterinaryValeriya", "VeterinaryValeriya\VeterinaryValeriya.csproj", "{69D21967-2A6D-4AAA-BAC8-DB15E7F26110}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VeterinaryKonstantin", "VeterinaryKonstantin\VeterinaryKonstantin.csproj", "{F2FD6890-FA1E-4D3B-A267-7CF9BE8AC499}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VeterinaryAlina", "VeterinaryAlina\VeterinaryAlina.csproj", "{86A66320-1CF7-4439-946E-399A2E30E580}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -56,26 +46,6 @@ Global {0B86DA56-DD67-4418-A8A4-9A6E058EC444}.Debug|Any CPU.Build.0 = Debug|Any CPU {0B86DA56-DD67-4418-A8A4-9A6E058EC444}.Release|Any CPU.ActiveCfg = Release|Any CPU {0B86DA56-DD67-4418-A8A4-9A6E058EC444}.Release|Any CPU.Build.0 = Release|Any CPU - {76C9C915-3485-4158-B0CC-A3C6A9D0FAD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76C9C915-3485-4158-B0CC-A3C6A9D0FAD2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76C9C915-3485-4158-B0CC-A3C6A9D0FAD2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76C9C915-3485-4158-B0CC-A3C6A9D0FAD2}.Release|Any CPU.Build.0 = Release|Any CPU - {883BE9B6-9577-4261-9C62-3A637471ED12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {883BE9B6-9577-4261-9C62-3A637471ED12}.Debug|Any CPU.Build.0 = Debug|Any CPU - {883BE9B6-9577-4261-9C62-3A637471ED12}.Release|Any CPU.ActiveCfg = Release|Any CPU - {883BE9B6-9577-4261-9C62-3A637471ED12}.Release|Any CPU.Build.0 = Release|Any CPU - {69D21967-2A6D-4AAA-BAC8-DB15E7F26110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {69D21967-2A6D-4AAA-BAC8-DB15E7F26110}.Debug|Any CPU.Build.0 = Debug|Any CPU - {69D21967-2A6D-4AAA-BAC8-DB15E7F26110}.Release|Any CPU.ActiveCfg = Release|Any CPU - {69D21967-2A6D-4AAA-BAC8-DB15E7F26110}.Release|Any CPU.Build.0 = Release|Any CPU - {F2FD6890-FA1E-4D3B-A267-7CF9BE8AC499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F2FD6890-FA1E-4D3B-A267-7CF9BE8AC499}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F2FD6890-FA1E-4D3B-A267-7CF9BE8AC499}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F2FD6890-FA1E-4D3B-A267-7CF9BE8AC499}.Release|Any CPU.Build.0 = Release|Any CPU - {86A66320-1CF7-4439-946E-399A2E30E580}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {86A66320-1CF7-4439-946E-399A2E30E580}.Debug|Any CPU.Build.0 = Debug|Any CPU - {86A66320-1CF7-4439-946E-399A2E30E580}.Release|Any CPU.ActiveCfg = Release|Any CPU - {86A66320-1CF7-4439-946E-399A2E30E580}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE