Initial commit

This commit is contained in:
github-classroom[bot] 2025-04-29 15:03:45 +00:00 committed by GitHub
commit b087f272b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 5345 additions and 0 deletions

View 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
}