How to Program in C# - Conditions (E03)
Vložit
- čas přidán 11. 07. 2020
- Let's learn how to use conditionals in C#!
► Get The Complete C# Masterclass for only $9,99! www.udemy.com/course/complete...
● Watch the previous C# tutorial: • How to Program in C# -...
● My Solution to the Challenge: bit.ly/31eXoFI
👕Get the new Brackeys Hoodie: lineofcode.io/
····················································································
❤️ Donate: www.paypal.com/donate/?hosted...
► Join Discord: / discord
● Website: brackeys.com/
● Twitter: / brackeystweet
● Instagram: / brackeysteam
····················································································
► All content by Brackeys is 100% free. We believe that education should be available for everyone.
❤️ Donate: www.paypal.com/donate/?hosted...
····················································································
♪ "ES_Dress Code_Black - oomiee" by Epidemic Sound
I'm sad this channel stopped. I just found it!
same
yes me too
same
same ;-;
same :/
Brackeys: types lines of code faster than the speed of light like it is nothing
Also Brackeys: (4+3+2+1)/2 = 6
F
The easiest way he could have caught it is if the if statement didn't contain the answer but the calculation itself.
Malek Wa3er is the answer 10?
@@rosechan8258 it's 3...
edit: it's 5
@@honorsoftentertainment484 yes Ik. my edit didn't go through
Yes finally a programming tutorial that is actually good and explains everything perfectly.
Haris Sabotic well definitely one of the few best
You make it sound like he's the only one with a good programming tutorial, yet I can give you a list of people who have good tutorials.
If you search for free code camp in youtube there will be hours long of tutorial for C#, Java, Phyton etc
@@onlymal31 freecodecamp wastes too much time
@@smokedplus i think so too but I need this kind of teaching if I want to understand it as other tutorial it's like they expected us to understand everything from to beginning or they say like "I will explain this later" and never/show it at the end of the playlist
Honestly, I never thought I'd understand a single line of code, but following along these tutorials, I think I'm finally starting to get why and how people do thing 😂 After the first ticket example, I tried to do the rollercoaster one without looking at how you did it! Of course I know that this is just one of the most basic stuff you can do, but it still felt freaking amazing when I got it right!!
Thank you sooo much for this series, it’s just a shame that we have to wait a weak for a new episode but keep up the amazingggg work...
this
Yeah it’s kind of annoying
@@thefork4416 imaging working so hard to have a kid on his video complaining about the time you take to maake the viddo lmao lmao
Ashiiru I’m sorry
@@thefork4416 its ok, I just think sometimes people are not grateful with they have
One more thing
For newbies,an extra tip is that if you put an ! behind the condition,it will be reversed.So if the condition is true,with ! now it's false and if it's false,with!now it's true.Example:
!num >5
If the condition is true(num is greater than 5),now it's false,but if the condition is false(num is not greater or it's smaller than 5),now it's true.
And another great tip is you can reverse a boolean value with this syntax(assuming your boolean value is called boolName but the name can be changed):
boolName = !boolName;
So,keep these tips in mind,they will prove helpful.
Underrated comment
Hey Bracks, I just wanted to say thank you for helping me with C#, I am a 14yrs Old game Developer and You're videos have really helped me a long way thank you I've been looking at your Older YT videos about C# and you've really helped me boost my confidence. Once again Thank you
Nice i am in your same situation, unfortunately i dont understand much from the older tutorials, so i have to wait for one every week
Nicceees
Same here Rave :))
@@DiamondZap Same yet 2 years younger.
@@DiamondZap im 15 fam and same situation
Not only did I make the math game, but I also made a score system that gave you your score out of 3 and as a percentage at the end. I have never been more proud of myself.
He teaches so well that we are already into if statements in ep 3
Normally people would spend 10 videos then come to if statements
he teaches so well that people can understand and can move on quickly
Brackeys: uploads a tutorial on C#.
also Brackeys: gets sponsored by a guy who teaches C#.
edit: oof i didn't expect to get so many likes. (btw i haven't checked on this comment in like 7 months)
@chispers nothing
Console.Title = "Random comment";
//I mean at least its easy understand in a minute than a full course c#, i don't know if u joking around or....
if (you'reJoking)
{
Console.WriteLine("Nice joke");
}
else
{
Console.WriteLine("LOL be grateful dude");
}
Console.WriteLine("Don't take my joke too seriously ");
Console.ReadKey();
berry raspberry omg noob
@@birkefar xD
@@berryraspberry162 this kind of comments always make me laugh idk why xdxd
this playlist has been helping so much more than any beginner tutorials i've been finding.
you explain what the code does, but the best part is that you give us a small challenge that gives us a chance to learn something. i havent looked back at the code except for the first challenge, when i forgot one thing i needed, but not again yet. every other beginner tutorial had me looking back every couple of seconds.
this is what more tutorials should be, instead of just showing what this does, give the people who need it a bit of "homework" to have them do it themselves, because that way it sticks, rather than when you manually copy every line.
thank you so much brackeys!
when i watched other tutorials i got bored of programming but you make your tutorials so fun that when i go to sleep i cant wait to code and learn to code more. Awesome!
and i like the fact that he gives us homeworks so that we will learn it better.
Thank you!
Thank you for all that you did, i will miss you.
These videos are really helping me learn c#. These videos are my starting point for c#. I really want to be a game dev as a career and I think this will help me. Thank you for making these videos.
Awesomeee 🤣
Hi😳
fun fact: u only like this because is a verified account :)
What's funny?
Me: "Help, I don't know what to do!"
Brackeys: "Do do doop doop, do dododo doo!"
12:05 Thanks for this one! With this "switch", I can finally give different messages for each scores for the score counter I made!
YandereDev could definitely learn one or two things here.
I don't think his ego will let him take coding advice from anyone. Remember what happened with tinybuild?
Yeah, all these if statements...but I have to say that he used an old an unefficient lathfinding system...
Underrated comment
Unfortunately in this tutorial Brackeys doesn't teach us how to model a toothbrush.
He optimized his code alteady. But only small parts...
Damn I love this series soooo much, I'm actually learning a whole lot. Can't wait for the next episode! Keep it up!
this is a great course for beginners. love it. I wish they continued the course.
Yay another tutorial. I admit it, these are the cleanest, fastest and most beginner friendly. Just the best tuts out there!! Asbjorn and team are awesome!!
I always thought c# was hard but you made it seem super easy. Thx Brack!
Very hopeful tutorial's . I never had with C Sharp, and in these 4 episodes i learn very good . So Thanks a lot for these tutorial's!
Thanks for these more basic tutorials dude! You are really helping me out! I can't wait for more!
if statements. "Finally". I have tried to learn from other teachers, and gotten to if statements but never really understood what I learned before then. Just kinda thought "well, I will manage". I completely understand up to this point, and thank you for being such an excellent teacher. Not just you, but also whoever helped you write this and the production team.
Please keep doing these programing tutorial videos, they really help me study
If you only upload videos on Sunday this series will never ends. Especially if you're considering to cover Advance stuff , like OOP , design patterns , principals, algorithms etc
You are my savior, Brackeys. Thanks to you, my dad is impressed of my work and refers it as a hobby, and not as a slack-off job. If you're reading this, God wish you the best in your life.
Such a helpful video. I am currently on episode 4 and started yesterday. Thanks for sharing this!
This is a great series to see if I have gaping holes in my current coding knowledge ;)
jelle, shut up. you're a genius.
@@hypehextech4680 you're*
Shame this series is so new and we have to wait. These tutorials are so helpful :D
This series, is the first that has actually helped me learn C#.
isnt this ironic that of all the years i put to learn programming without success, this is where i finally learnt how to code and understood programming because of the simplicity of the approach , direct to the point and no unnecessary confusing information and grandocious grammer ! my sincere gratitude to Brackeys!
This guide is completely outdated and misleading. You’d never find movie tickets for $5 nowadays.
They had us in the first half, I’m not gonna lie.
@@ev7r i was literally about to say that
(now i cringe at self)
Bruh your life is outdated
Damn diamond really roasted u thats crazy bro
Sidefluux
Thx
YandereDev really just watched half of this video and made the whole game
So far this has been really fun and I am really like the challenge at the end big props to you making this experience fun
Thank you for the amazing content and tutorials you give us! You have no idea how much this helps me out.
With this publishing schedule you'll get to arrays in 2022...
More like in 2-3 months...
@@harissabotic5714 Kinda exaggarated to prove my point you know. I'm way past begginner point and subbed here for other reasons but I watch this tutorial for fun. Still I couldn't remember what was the last episode about...
I agree with you, but this tutorials have some very high quality, and we can't imagine how long it might take to produce
They're consuming the whole channel. 4 of the 6 videos in the last month are these basics of programming that most of the audience already knows. And he's not even putting them out fast enough that an actual beginner can follow along.
@@TheSpacecraftX Im having no trouble at all
im just wondering, how would you go about making a final score at the end of the math game you make.
Edit: I figured it out, if anyone wanting to add a score to the game you would want to right int score =3; then for every question they got wrong put in score = score - 1;
a complete question would look like:
if(ans01 == 31){
Console.WriteLine("Correct!");
} else if( ans01 != 31) {
Console.WriteLine("Incorrect!");
score = score - 1;
}
Hope this helps if you wanted to add a score.
i think that "score--;" should work too (two minus in a row). It does the same as "score = score -1;" but it's shorter. There is also *var name here*++, but it adds one instead of substracting. Hope i said you something useful :) (btw your code is fine i just thought i should show you the -- and ++ operators)
Michal Simanek is this a cursed comment?
@Kyle Shim if you are still struggling with this, its probably because you need to declare the variable "score" (or whatever you want to call it) into your code
I love your videos, you inspire me to keep pushing forward in-game development and I'm a huge fan
thanks for the great tutorial, you're truly helping me with everything
Me: Watching Brackeys video's because I just started game development and I need to learn things
how are you going now 5 months down the road? im only starting now in unity
Good luck on creating a good game.
@@eoinbyrne9068 Same
@Fiadel Veis Welp, I haven't made much progress tbh, Ive went in waves of doing some and then none for a while, also busy with school so haven't had the energy or motivation, hopefully will have more time in the summer.
@Fiadel Veis thank you, appreciate the kind words, I wish you the best of luck in your future 👍
YandereDev need to see this tutorial xDD
He already saw this tutorial. This is where he stopped
@@CapitalCrimez No, he stopped just before the switch statement.
Copied joke, but nice logo
@@nighthawk8193 He only saw the thumbnail
why tho i dont understand explain pls
dont r/whooosh me
I have been coding on python for about a year so I know allot about Conditions , variables, lists etc. but I eventually realized that python code was limited for game development so I decided to switch to C#. Thanks for the tutorials, its really helping me :D
Thank you!! was looking forward to this video! Very helpful
11:06 is the perfect timestamp to fix Yandev's code.
Oof
The “if else” part gives me YandereDev flashbacks...
If else * infinty
why is this the best type of tutorials? i hope you have more language tutorials cause ill be here for a while!
i couldn't do a thing with a lot of if statements and you solved all my problems, thanks, also thanks because with you i started my journey in coding
I wish homework was this fun at school...
Console.Title = "Top 1 Comment";
Console.WriteLine("This is very similar to math, very easy to understand");
Console.ReadLine();
Console.WriteLine("I love your vids man i subbed, btw i just found out your vids yesterday");
Console.ReadLine();
Console.WriteLine("Wish you have a wonderful day :)");
Console.ReadKey;
Genius :)
I dont thjnk you need the Console.ReadLine(); i mean more than once
@@Andres-vd8uy it clearly does not matter, even though he can then write text then press enter.
@@prishpundikalpaka6879Console.WriteLine("fr he sure did forget the () after Console.ReadKey")
*Top 1 Comment*
Console.WriteLine("This is very similar to math, very easy to understand");
*yes, I somewhat agree*
Console.WriteLine("I love your vids man i subbed, btw i just found out your vids yesterday");
*I was here for a bit*
Console.WriteLine("Wish you have a wonderful day :)");
Console.ReadKey;
*Exit*
Thank you so much :) this really easy to understand and save a lot of time learning. Again, thank you so much!
Great video, Thanks!
How are there dislikes already? The video has been online for max 1minute and nobody has watched it to the end, same with likes
so agree
because there are a million coding tutorials out there. I don't need another one. Brackies has so many unique videos I can't find anywhere else, and this is not one of them. Feels like filler content. Even if he is serious, is he going to do a 200 episode + tutorial on coding? Because that's what is realistically necessary without going to another channel anyways. That is not his style and he won't put much content into this series anyway so why bother.
Brackeys just taught me how to write a switch statement in less than a trillionth of the time YandereDev's stuck to else if statements.
This is solid work. My suggest for a future topic would be how to deal with garbage values from the input stream and moving the game forward in spite of it. Apologies if this was already covered somewhere in your other videos.
Awesome your tutorial are enjoyable not boring man I like the way you explain. After going through several CZcams channel finally and finally have arrived. Thank you Man
11:07 leaked code from yandare dev
I hate how the US decided to not use the metric system...
How old is 190 cm?
Thanks for these videos Brackey. Halfway in and I am really enjoying it! Only regret is that I didn't start earlier with programming.
I hate coding or computers per say but i am stuck to do it and and i searched tutorial and man !!!! your voice is so soothing and you are lamely funny, i am actually learning something!! its awesome
Thank you sincerely
I made it tell me how many i answered correctly out of all the questions as well did'nt take that long.
Keep up the good work and videos of great quality.
I learn it from the start to this in one day. All thanks to you i could create these wonderful code!
Please keep doing these frequentley, it helps so much
Can we appreciate the fact these beginning tutorial episodes are what you need to know to start a basic game!
Thank you so much for making these fun and very well explained videos. I'm actually having fun coding now
Thank you so much for making this easy to get into!
the euphoric moment of managing to complete brackeys's challenge (with minimum 'checking back on the video to see if what i wrote is correct') correctly but also the dreadful feeling of being unaware if it's formatted completely wrong and vscode just forgave you
I learned these things almost 2 decades ago, but Brackeys' videos are so inspiring that I am here, watching hahaha
That's just a wonderful tutorial, thanks Brackeys
This tutorial is great! I actually know how to code in Java. By seeing the similarities but also the differences it helps me a lot for Unity-Coding.
Thanks so much this was so helpful!!
Did the challenge on the previous video in the series! With no help! I just got into coding, and really want to get into game development. Thank you brackeys! Sad to see you go.
this is really helpful, thanks!
Thanks Brackeys!
I HAVE NEVER IN MY LIFE BEEN SO EXCITED TO DO HOMEWORK AND I ABSOLUTELY HAVE NOT BEEN SO HAPPY TO GET IT RIGHT.
You helped me soo much I really appreciate your work
i actually learn a lot from these thanks
I refused to look at the answer and after like half an hour the lesson out. This is really fun!
Thank you so much
Love this series keep it up
great video, helps a lot
I have been patiently waiting for you to upload the next episode. Finally....
Incredible video
This helped me so much thank you
Great video!!
I would of at least expected you to have introduced the, in my honest opinion, the better way to convert strings to numbers or booleans, that being the TryParse. I feel like that could have been used here well. TryParse is better since if it fails to parse, it won't crash the program/task and you do not need a Try-Catch. It outputs the value using the out parameter, which you could explain in a later video. Convert is mainly good when you need to convert one type to another, ie, System.Object to say System.Collections.Generics.IList (and yes, I did have to do that for my settings manager in quite a bit of programs I made), while TryParse or Parse is good for user input AND it does make it easier to read. For an int it is just int.TryParse, float is float.TryParse, decimal (yes this is an actual type, it is a 128-bit float) is decimal.TryParse (the same goes for all the other primitives, and just remove the Try and remove the out parameter and now you have the Parse method.)
Thanks this was really useful for my game!
this is a great serie, i started programming 1 year ago but after a lot of tutorials i only learned how to copy code... This serie is clear and slow. i also really like how you give us assigments to test if you know how it works. keep this going youre helping me really much!
Wise....
I learned more in this vid than any other
Nice work!
Bracky, you are the bees knees thank you so much for the 9$ course holy shit this is a steal!
The new best way of learning code
Onward to the next video!! Lets keep this pace up folks!
I have juggled around lots of languages, but I couldn't actually learn them. However, in these tutorials, I feel like I am actually learning something.
Best channel for unity developer 😁😁😁😁
I bought that Udemy course he talked about in the beginning a few days ago, and I can't understand a jist of it, I felt as if nothing is truly explained what its for.
These small tutorials here are a lot more comprehensible.
You are the best one 💖
Thanks.. " Brackeys" for the video. We always learn alot from your videos. I wish I could support 😔 you on patreon. But never the less thanks.
finally another episode! :)
Thanx so much for it