This commit is contained in:
2018-04-13 14:34:15 +02:00
parent 04f02fbb93
commit 06c8e76f99
4 changed files with 74 additions and 63 deletions

View File

@ -1,39 +0,0 @@
using System;
using System.Collections;
using System.Collections.Generic;
namespace Yavsc.Models.IT.Modeling
{
public abstract class Code<TLetter> : ICode<TLetter> where TLetter : ILetter<TLetter>
{
IEnumerator IEnumerable.GetEnumerator()
{
throw new NotImplementedException();
}
/// <summary>
/// !a Count^3 task len
/// </summary>
/// <returns></returns>
public bool Validate()
{
foreach (var letter in this) {
var word = this.CreateWord(letter);
foreach (var other in this) {
IWord<TLetter> first = word.Aggregate(other);
foreach (var tierce in this)
{
var otherword = word.Aggregate(tierce);
if (first.Equals(otherword))
return false;
}
}
}
return true;
}
public abstract IEnumerator<TLetter> GetEnumerator();
public abstract IWord<TLetter> CreateWord(TLetter letter);
}
}

View File

@ -1,14 +0,0 @@
namespace Yavsc.Models.IT.Modeling
{
public abstract class Letter<T> : ILetter<T>
{
public abstract bool Equals(T x, T y);
public int GetHashCode(T obj)
{
return obj.GetHashCode();
}
}
}