JTN
JTN
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
Thanks
21 replies
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
i will
21 replies
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
the reason i placed a ? is so the warning there went away
21 replies
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
all the vars in arena must be static
21 replies
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
that is the task for school
21 replies
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
i am new to C# btw
21 replies
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
i geuss and the last line gives a warning that i dont know how to fix
21 replies
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
because everytime i want to use Trainer1 it needs a ?
21 replies
CC#
Created by JTN on 4/26/2024 in #help
✅ null thingy (SOLVED)
do i have to do Trainer1? everywhere or is there a shortcut?
21 replies
CC#
Created by JTN on 4/24/2024 in #help
✅ any improvements?
C#
using System;

namespace IDK
{
public class Functions
{
public static string AskString(string Question)
{
while (true)
{
Console.WriteLine(Question);
string? UserInput = Console.ReadLine()!.ToLower();
if (!string.IsNullOrEmpty(UserInput) )
{return UserInput; }
}
}
public static bool AskYesOrNoQuestion(string Question)
{

var UserInput = AskQuestion(Question, ["y", "yes", "n", "no"]);

return new string[] { "y", "yes" }.Contains(UserInput);
}
public static string AskQuestion(string Question, string[] Awsners)
{
while (true)
{
Console.WriteLine(Question);
string? UserInput = Console.ReadLine()!.ToLower();
if (Awsners.Contains(UserInput))
{ return UserInput; }
}
}

}
}
C#
using System;

namespace IDK
{
public class Functions
{
public static string AskString(string Question)
{
while (true)
{
Console.WriteLine(Question);
string? UserInput = Console.ReadLine()!.ToLower();
if (!string.IsNullOrEmpty(UserInput) )
{return UserInput; }
}
}
public static bool AskYesOrNoQuestion(string Question)
{

var UserInput = AskQuestion(Question, ["y", "yes", "n", "no"]);

return new string[] { "y", "yes" }.Contains(UserInput);
}
public static string AskQuestion(string Question, string[] Awsners)
{
while (true)
{
Console.WriteLine(Question);
string? UserInput = Console.ReadLine()!.ToLower();
if (Awsners.Contains(UserInput))
{ return UserInput; }
}
}

}
}
15 replies