✅ I need help with a c# project (I'm a student)
Hello, I'm a student on my first year of programming. We're currently learning c# and we just got assigned to create a Black Jack game as a final project. Me and my project partners are stuck and we need some help.
21 Replies
What problem(s) are you facing?
Not many people will want to download a .rar to help. Is the code available on github perhaps? If not, can you make it available, or upload the important parts on $paste
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
And as many details on what the problem(s) are and what you have tried so far.
our problem is that we got stuck because we don't know how to structure the classes
I have some of the code that is necessary, but from there I don't know how to continue
BlazeBin - enbzjuhkedzy
A tool for sharing your source code with the world!
If the solution has to be object oriented, then you'd have classes like
Player, Deck, Card
And looks like you already have that!
but we don't know what to put in each class, like which should inherit some classes
At the moment we're trying to figure out how to shuffle the cards that we established on the array
If you are allowed to use LINQ I usually do something like
Literally orders by random function
we havent seen any of that yet, i dobut we're allowed to use it
you could also just google "fisher yates c#" and you'll get a shuffle implementation 🙂
its a tried and tested shuffle algorithm
and that would go in your deck of cards, obviously - as you shuffle a deck, not an individual card
I see no particular reason to use inheritance at all in a blackjack app
+, you don't seem to need it here
okay, we'll forget about inheritance for now. Back to the shuffle algorithm, it would be better if we made the shuffling by ourselves using a random or at least basic coding since we're supposed to use what we've been taught and we're just begginers
then do that. you can still look up what "fisher-yates shuffling" is and try to write code that implements that yourself
is this right?
Yup!
That's correct!
Though a small note
Usually, you shouldn't make fields public
public string valor;
Instead use auto properties
public string Valor { get ;set; }
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.BlazeBin - ppiaiethnqih
A tool for sharing your source code with the world!
How do I shuffle the cards and deal them?
I'm not understanding come on and I'm getting involved every time ams
If you want to implement shuffling yourself you can try Fisher Yates method
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.