Learning Some Basic C# Stuff

Greetings, fellow sentient beings!

I have been following a crash course in C# since I wanted to get to understand programming languages a bit more. And then probably another bit more...Then a byte...And so on...until I am able to build projects of my own.

For instance, I want to make a version of the Western Shores board game that I am currently working on...a version that would be available for you all to play online, too. But that shall be...many months and probably even a couple of years from now.

Anyway, it's a goal. And where there's a goal...

Yeah, maybe it was not the perfect language to start learning but I still think it will help me understand the others better. Later. Much later.

So far, I have mostly done some small tasks, most of them copied but tweaked a bit. I am sure I understand all of it and that is the important part. To know how to do those myself and meanwhile learn some of the grammar and syntax of the code.


So far, I've learned how to get user input, basic maths operators, accessing some premade Methods, building new Methods, also...

Methods Return a C Sharp Code Cheatsheet 003.jpg
Although I think that convention asks for a capital C on Cube here.


... If and Else Statements...

If Else Statements C Sharp Code Cheatsheet 004.jpg


... using those to make a basic calculator...

Calculator a C Sharp Code Cheatsheet 005.jpg

...


...or a basic guessing game...

Guessing Game C Sharp Code Cheatsheet 008.jpg


... do-while loops...

Do While Loop C Sharp Code Cheatsheet 007.jpg

...


...switching stuff

Switch C Sharp Code Cheatsheet 006.jpg

...


...for loops...

To The Power Of C Sharp Code Cheatsheet 009.jpg
It seemed a complex way to get some number to the power of another number at first...


...exceptions handling...

Exceptions C Sharp Code Cheatsheet 010.jpg

...and more.


Like populating one or more dimensional arrays. I am now into classes, objects, etc.


The things I would like to know and haven't found the answers to yet:

How do I toggle night mode of this new version of Visual Studio - simple, I guess, and yet elusive. The previous versions I had turned out to have been...expired. It was in night mode but not this one.

Now seriously - is there a proper syntax to pass a range of numbers. From 1 to 99, for example. Actually, I have to try if "1-99" or "1,..., 99" or some such would do.

And my current set goal - to learn how to get Random elements of a class or of an array. So that I can build my simulation of the drafting phase of the card game I mentioned above.


Thank you for being around! Learning is so much more fun when I can share ;)




Yours,

Manol

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center