theo
theo
CC#
Created by live4eternity.jp on 4/16/2023 in #help
❔ Need help translating this psuedocode
static List<T> Merge<T>(List<T> left, List<T> right)
where T : INumber<T>
{
List<T> result = new();

while (left.Any() && right.Any())
{
if (left.First() <= right.First())
{
result.Add(left.First());
left.Remove(left.First());
}
else
{
result.Add(right.First());
right.Remove(right.First());
}
}

return result;
}
static List<T> Merge<T>(List<T> left, List<T> right)
where T : INumber<T>
{
List<T> result = new();

while (left.Any() && right.Any())
{
if (left.First() <= right.First())
{
result.Add(left.First());
left.Remove(left.First());
}
else
{
result.Add(right.First());
right.Remove(right.First());
}
}

return result;
}
Perhaps something like this
9 replies
CC#
Created by live4eternity.jp on 4/16/2023 in #help
❔ Need help translating this psuedocode
Couldn't you make it generic and contrain T to INumber<T> and make the two Lists be List<T>?
9 replies
CC#
Created by theo on 3/13/2023 in #help
❔ Randomizing stuff like AssemblyName etc on Build
The exact error message is this
<omitted>.csproj : error : The element <AssemblyName> beneath element <Project> is unrecognized. <omitted>.csproj
<omitted>.csproj : error : The element <AssemblyName> beneath element <Project> is unrecognized. <omitted>.csproj
4 replies
CC#
Created by theo on 3/13/2023 in #help
❔ Randomizing stuff like AssemblyName etc on Build
In my case, VS complains specifically about the <AssemblyName> entry, saying its wrong
4 replies