How to Program in C# - Methods (E06)

preview_player
Показать описание
Let's learn how to re-use code with methods in C#!

····················································································

········································­­·······································­·­····

► All content by Brackeys is 100% free. We believe that education should be available for everyone.

········································­­·······································­·­····

♪ "ES_Dress Code_Black - oomiee" by Epidemic Sound
Рекомендации по теме
Комментарии
Автор

I had done a 50 hour C# course and it didn't do me much, plus it cost 30$.

But your series of videos are so clear and simple that I am now even better than my friend whos been coding C# for 3 months! Thanks a lot Brackeys!

Wonrofccsreal
Автор

The last two challenges I had to look up on the forum but I bloody got this one!!! Some trial and error and some seriously hard thinking went on but as an absolute beginner not just at C# but in the world of programming itself, I am very very proud of myself, the sense of achievement is immense, and I feel like with this challenge I've actually built a useful tool, amazing! Thank you so much brackeys!

abeautifulwasteoftime
Автор

Brackeys: "so ill set the age to be between 10 and-..."

Why do I hear police sirens?

jagorjurekovic
Автор

I think making a solar system simulator would be cool. This series is really helpful BTW.

gamergreat
Автор

This was really beginner friendly! Also like that you didnt make this specific to Unity

imgeorgeofficial
Автор

Brackeys please make this series a long one, its very helpful and I cant thank you enough for all the knowledge you are giving for free. Thank you so much

pankajbhatt
Автор

Even after 3 years, your videos are super helpful. I did all your homeworks without looking up the solutions. Especially this one took me a bit, but then it suddenly clicked and after some modifications, it runs perfectly fine and it's not much code. :)

Zombienonne
Автор

very happy i did this challenge with no help!
here is my code :D
upitnik();






Console.ReadKey();

static void upitnik()
{
Console.WriteLine("Write a sentence: ");
string sentence = Console.ReadLine();
int wordCount = sentence.Split(' ').Length;
Console.WriteLine("The amount of words in this is " + wordCount);
}

aleksandarmilovanovic
Автор

When you have 36 errors, write one letter, and all the errors are gone.

honkinghorse
Автор

This series has helped me so much thanks brackeys

Deshay_
Автор

The joy that i felt when i guessed that you were gonna say "return result" is absolutely overwhelming

DraDuck
Автор

I've never used any programming before but this series is amazing - I modified this tutorial so that the user was able to input their own numbers on command, so it works as a calculator of sorts. I know it's simple but if you'd have asked me a week ago I'd be clueless, so thank you so much :)

(also this is the first challenge I'm stumped on </3)

mikaazai
Автор

This video is perfect. Really.
Even the way of promoting sponsor is great, it shows it at beginning and reminds you to check it out at the end.

omerfarukbykl
Автор

So, a year and a half later I'm running trough the course and I must say they are still great!
This challenge had me a little stumped for a bit, but only because I was looking for the why.
Why would you use a method or function, when you can just as easily write it in main.

The answer is: just for practice. Ours is not to reason why, ours is to reason how.
Once you get past that the solution of the challenge is easy.

The practice is in separating which variable can get called where, why you can use the same definitions for variables over different methods/functions and
to help you practice organizing and cleaning up your code.

Hope that helps you solve it, before going to look at the forum and find the solution!

Bergdwerg
Автор

Thank you for this video! Easy to understand, good examples, no bs. Loved it!

iuserlol
Автор

heres a quick tip: just type cw and enter
insted of typing console.writeline(); to qucikly print

SugarLightStudios
Автор

Looking forward to the next couple tutorials. Having trouble understanding how to utilize class modifiers and how to communicate between multiple scripts. Thanks for making these!

knifeninja
Автор

Wow, I started watching these, like, 2 days ago.

Didn't expect a new one _that_ soon.

tageneislover
Автор

The quality of these videos are incredible!

detectiveg
Автор

Honestly, thank you very much for making these tutorials, you are the reason i finally pushed myself and started doing something! Also this is the last episode where i had a little bit of knowledge about the thing i was doing. Next time classes? wtf is that

Im really hyped to find out next time :D

michalsimanek