[C#] Programming Exercices

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
Timie
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 2
Joined: Tue Oct 20, 2009 3:11 pm

[C#] Programming Exercices

Post by Timie »

Hello, Ive just started programming again after many months.
the last time i tryed i used c++ but i gave that up since i moved on things to fast and i felt that i went on beginning programming games and such ( with SDL ) before i learned the language properly,
i felt that my projekts where 80% copy and paste 15% altered copied code and 5% of my own.

anyways now i want a fresh start and ive heard good things about c# and since it have many similarities with c++ i decided to go with it.
since i just recently started with it i havent come so far in it ( school, private life you guys know the drill ) and i decided to take my own approach on things instead of rushing things like i did last time.
anyways i feel like that i need some exercices and perhaps smaller projects ( later or ) so i dont just read so i went here in hope of you guys helping with me some suggestions :lol:

the first i did was a codelock thing ( remember ive only coded in c# for like a day or two so dont flame on me that im noob cause i know that :mrgreen: )
Image
and i mean exercices like that, i´ve been trying to think of my own but i lack imagination :mrgreen:


P.S I know this is a forum for game developing and i hope its ok even tough this thread isint directly about game devving ( not wanna go down that path again for a while ;) )
User avatar
Pickzell
Chaos Rift Junior
Chaos Rift Junior
Posts: 233
Joined: Sat May 16, 2009 10:21 am

Re: [C#] Programming Exercices

Post by Pickzell »

Well, I don't know C#, so I can't tell you recommended exorcises, but you could try making up text games from what you do know.

I.e. You learn random numbers, you make (text-based)poker.
I'm an altogether bad-natured Cupid.
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: [C#] Programming Exercices

Post by Falco Girgis »

That's a pretty cool "Codelock." Way better than anything I had done after a day.

This forum is for general programming. I post all sorts of non-game development related stuff here on a regular basis. We also don't flame people for being new. Welcome. :D
User avatar
dandymcgee
ES Beta Backer
ES Beta Backer
Posts: 4709
Joined: Tue Apr 29, 2008 3:24 pm
Current Project: https://github.com/dbechrd/RicoTech
Favorite Gaming Platforms: NES, Sega Genesis, PS2, PC
Programming Language of Choice: C
Location: San Francisco
Contact:

Re: [C#] Programming Exercices

Post by dandymcgee »

That looks like a fine start. I just started programming in C# the beginning of last month for my Intro to Programming class. So far it's not too bad, although I definitely prefer C++. The only thing that really bothers me so far is array declarations, but that' just a pet peeve.

Welcome to the forums and feel free to post if you have any questions about anything. :)
Falco Girgis wrote:It is imperative that I can broadcast my narcissistic commit strings to the Twitter! Tweet Tweet, bitches! :twisted:
User avatar
MarauderIIC
Respected Programmer
Respected Programmer
Posts: 3406
Joined: Sat Jul 10, 2004 3:05 pm
Location: Maryland, USA

Re: [C#] Programming Exercices

Post by MarauderIIC »

Hmm... exercises.
How about populating a dropdown/combobox with all the lines from a particular file, based on the result of another dropdown, which lists all the files in the working directory?

So, like, say your c# executable is in mydir. And mydir has files
a.txt
b.txt
c.txt
e.exe
f.dat
g.doc
abc.txt

And "a.txt" contains
"why
qq moar
please 111 9328"

When you run your program directly (or set your project's working directory/position your files so that the program works right), dropdown 1's options are
a.txt
b.txt
c.txt
And dropdown 2 currently has no options.

And when you select a.txt, the options in dropdown 2 become "why" and "qq moar" and "please 11 9328".
Bonus: let the user define file matches with the usual wildcard style. IE, a* will make "a.txt" and "abc.txt" show up. *.doc will make "g.doc" show up. *b* will make "abc.txt" and "b.txt" show up. g.doc will make g.doc show up, and nothing else.
I realized the moment I fell into the fissure that the book would not be destroyed as I had planned.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: [C#] Programming Exercices

Post by eatcomics »

That's cool mar :)

What about a calculator? I would imagine that would be a good c# exercise...
Image
XianForce
Chaos Rift Devotee
Chaos Rift Devotee
Posts: 767
Joined: Wed Oct 29, 2008 8:36 pm

Re: [C#] Programming Exercices

Post by XianForce »

Well I've been recently going through C#, and I made a program that takes a string from the user, converts it to a byte array, encrypts the byte array, converts to a string then displays the encrypted string, then converts the string to a byte array, and decrypts, then displays the decrypted string.

I also had it display the byte arrays in debug mode...

It was fun =p
Timie
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 2
Joined: Tue Oct 20, 2009 3:11 pm

Re: [C#] Programming Exercices

Post by Timie »

thanks for all your ideas.
i havent been able to be on the computer or study c# since i made this thread so i havent been able to reply sooner, sorry ;)

ill start with ur ideas, ill post here once i complete one :)
Post Reply