Комментарии:
One thing I just discovered. Just like you can put an "f" at the end of a number to make it a float, you can also put a "d" to make it a double.
Ответитьhow can you write a code that has like 4 candidates and counts the number of votes for each candidate and not percentages?
Ответитьlike!
ОтветитьThanks for the tutorial!
Ответитьwith swapped multiplication and division in percentage computation it should work with integers
ОтветитьStarting programmer here, when you challenged us to think of the logic for the results I paused the video like you suggested and tried to do it myself.
First I wanted to use an And statement but I immediately failed because I don't know the syntax for it.
So I resumed the video to maybe see that syntax but instead you started nesting If statements, so I paused and tried again using nested If.
so I do
if (yesCounter > noCounter)
{
if (yesCounter > maybeCounter)
{
Console.WriteLine($"Yes Won");
}
else if (maybeCounter > yesCounter)
{
Console.WriteLine($"Maybe Won");
}
else
{
Console.WriteLine($"DRAW Between Yes and Maybe");
}
}
At this point I resume the video since I think I got the gist of it.
To my surprise you say that after the else there is a draw. (as opposed to just a draw between Yes and Maybe)
I scrub through the rest of the tutorial and I think you do not address my be-puzzlement
So, at the risk of looking like a fool, I present to you with what I think is the code that actually addresses all possible scenarios:
if (yesCounter > noCounter)
{
if (yesCounter > maybeCounter)
{
Console.WriteLine($"Yes Won");
}
else if (maybeCounter > yesCounter)
{
Console.WriteLine($"Maybe Won");
}
else
{
Console.WriteLine($"DRAW Between Yes and Maybe");
}
}
else if (noCounter > yesCounter)
{
if (noCounter > maybeCounter)
{
Console.WriteLine($"No Won");
}
else if (maybeCounter > noCounter)
{
Console.WriteLine($"Maybe Won");
}
else
{
Console.WriteLine($"DRAW Between No and Maybe");
}
}
else if (yesCounter > maybeCounter)
{
Console.WriteLine($"DRAW Between Yes and No");
}
else if (maybeCounter > yesCounter)
{
Console.WriteLine($"Maybe won");
}
else
{
Console.WriteLine($"THREE-WAY DRAW!");
}
Besides this oversight in this tutorial, it is very helpful indeed.
You explain at a good pace, which is excellent because one can just pause and/or rewind the video if something was not clear or moved too fast for them to follow.
I will now continue the video and see what this excess thing is about.
Thanks for making these
edit: So I finished the tutorial and you do acknowledge some different draw conditions, although not all of them. I'm sure you did notice some cases were missing, but decided to leave it as is anyways. Perhaps the "Naive" in the title of the video has got something to do with it also?
Thanks for this tutorials, u are so good teaching code.
ОтветитьWhat about the promised Flutter tutorials?
Ответить