Initial commit
This commit is contained in:
commit
b087f272b4
26 changed files with 5345 additions and 0 deletions
66
Numbers/NumberString/NumberString.cs
Normal file
66
Numbers/NumberString/NumberString.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
using System.Collections;
|
||||
|
||||
namespace Numbers.NumberString;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a string consisting of digits and letters intermixed
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="IEnumerable{T}" />
|
||||
/// <inheritdoc cref="IComparable{T}" />
|
||||
public sealed class NumberString : IEnumerable<int>, IComparable<NumberString>
|
||||
{
|
||||
// TODO
|
||||
// private readonly string _text;
|
||||
// private int? _numericValue;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of <see cref="NumberString" /> based on the given text.
|
||||
/// As a simplification, the text is assumed to be a valid number string.
|
||||
/// </summary>
|
||||
/// <param name="text">A string containing digits and letters</param>
|
||||
public NumberString(string text)
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the numeric value contained in the number string
|
||||
/// </summary>
|
||||
public int NumericValue => -1; // TODO
|
||||
|
||||
/// <summary>
|
||||
/// Gets the digit at the given index.
|
||||
/// If the index is out of range, -1 is returned.
|
||||
/// </summary>
|
||||
/// <param name="index">Digit index</param>
|
||||
public int this[int index]
|
||||
{
|
||||
get
|
||||
{
|
||||
// TODO
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public int CompareTo(NumberString? other) => -1; // TODO
|
||||
|
||||
public IEnumerator<int> GetEnumerator() => null!; // TODO
|
||||
|
||||
IEnumerator IEnumerable.GetEnumerator() => null!; // TODO
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
public override int GetHashCode() => -1; // TODO
|
||||
|
||||
public static bool operator >(NumberString a, NumberString b) => false; // TODO
|
||||
|
||||
public static bool operator <(NumberString a, NumberString b) => false; // TODO
|
||||
|
||||
public static bool operator ==(NumberString a, NumberString b) => false; // TODO
|
||||
|
||||
public static bool operator !=(NumberString a, NumberString b) => false; // TODO
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue