Naoriel Sa' Rocí 4a4fb54143 Added first code.
Signed-off-by: Naoriel Sa' Rocí <naoriel@sa-roci.de>
2026-03-30 02:26:31 +02:00

36 lines
627 B
C#

using System;
namespace EinmaleinsTrainer.Models;
public class Question : IEquatable<Question>
{
public int A { get; set; }
public int B { get; set; }
public int CorrectAnswer => A * B;
public bool Equals(Question? other)
{
if (other is null) return false;
return A == other.A &&
B == other.B;
}
public override bool Equals(object? obj)
{
return Equals(obj as Question);
}
public override int GetHashCode()
{
return HashCode.Combine(A, B);
}
public override string ToString()
{
return $"{A} x {B}";
}
}