mcacoeteuol's People
Forkers
xiriimcacoeteuol's Issues
Card arrays and ShuffleCardPack() method
Hi Marco, nice work so far, I like the testing class asking you which one you'd like to perform.
One issue in the Pack class is there is no attribute that contains a list you create one in the constructor called pack (don't think it's a good idea to copy the class name this way) but it's just a local variable.
Try adding above your constructor
Card[] cards = new Card[52]
then just filling it with the constructor accessing the indexes of it using cards[indexNumber] Bear in mind that an array is always the same length so if you remove cards from the pack or don't put any there it will instead be Card{null} in those indexes which could create problems later if not dealt with correctly.
next issue I saw that you are struggling to invoke the ShuffleCardPack() method. I think the reason why you cannot is because you haven't handed the method a pack which is one of the arguments of your method.
Your Code:
Pack.shuffleCardPack(typeOfShuffle);
Should be:
Pack.shuffleCardPack(typeOfShuffle, pack);
you could then access the packs attributes by using pack
Otherwise you could try removing the static keyword from this method and remove it as an argument. If the method is not static it would be called by an object so you can refer to that objects attributes directly within the method.
It's coming along nicely keep it up!
Review
Hi Marco,
Your program is coming along nicely.
Here are a few things I have noticed that might help you.
-
I noticed in most of your classes, they have a lot of white space. Is this needed, or can this be removed to improve readability?
-
You have some exceptions using the try catch approach. Have you thought about creating your own exceptions, perhaps using throw new Exception("").
-
when you print your cards to console, they print as numbers. Could this be more readable by converting those numbers to names i.e 1 = Ace, 11 = Jack and 1 = Spades etc. I have used enums within the Card class myself, others have used switch cases.
Hopefully this helps. I look forward tos eeing the final program
Typo in Console text
Hi Marco,
found a typo in testing.cs line 61.
Console.WriteLine("Would hou like to deal 1 card or many cards? ");
Code Review
Hey Marco,
From what I can tell the program is looking great.
-
As I'm not very proficient in C# it would be really beneficial if you could add some more comments into your code so that I can better understand what's going on and have an insight into your thought process.
-
Have you considered adding another class? This could help you chunk the problem a bit more and could help make your code more efficient.
-
I couldn't help but notice your code is sometimes hard to follow, if you improved the structure it would perhaps make the code more readable.
Looking forward to seeing the end result!
code review
well commented code. Easy to read thanks to the whitespace. I like the addition of the Player class to make it provide a more tailored experience.
here is a slight issue in the player class that allows for negative ages to be inputted. Probably best to handle these cases. Also, could just use two while loops instead of three when creating the pack. That way, the code will be more efficient (allows you to just add a simple if statement to check if the pack size is correct).
Overall really well done
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.