Dinosaure
changing a boolean value outside a loop from inside a loop
@zzz if you want to briefly test some C# code, you can use sharplab.io, it’s an online dev pad, where you'll find nearly everything you need for proof of concepts.
24 replies
changing a boolean value outside a loop from inside a loop
As stated, when a duplicate is found, count2 is incremented once; then, the condition for the bool change is
count2 > 1
, which won’t happen ever.
Maybe the condition could be count2 >= 1
?
Or maybe you can use LINQ, with bool duplicate = nums.ToLookup(n => n).Any(g => g.Count() > 1);
(requires using System.Linq
as a header), instead of the entire while
block?24 replies
✅ can somebody help me learn about smtp so i can make a email message sender please
Have you searched for resources online before posting here?
SmtpClient examples
Edit :
We don't recommend that you use the SmtpClient class for new development because SmtpClient doesn't support many modern protocols. Use MailKit or other libraries instead.
6 replies
Creating a class Player based on instructions
enum
stands for "Enumeration". It's a type that contains information about possible values.
You often find examples as enum WeekDay { Monday, Tuesday, ... }
, that you can then use as reference in situation like WeekDay currentDay = WeekDay.Saturday;
.
In the case of player colors, maybe you would have enum PlayerColor { Blue, Red, Green, Yellow }
.? If an enum isn't requested, you may also use already existing Color
types from System.Drawing.Color
.97 replies
whats this, is this just console or .net console when creating a new project with visual studio 22?
The namespace is file-bound on the right, block-bound on the left.
It doesn’t change the code, and removes one indentation layer.
Plus, as stated by @Pobiega, your Program is explicitly set to
internal
on the left, while kept implicitly internal
(by default) on the right. So both are the same code.53 replies