EDIT: Try that and let us know what you come up with, and then we can move forward from there.
Sure. Please show us what have you done so far and where you stuck.
If you got written steps in english how you are going to do it, just post them here, in case you finished all that already and started coding, please post actual code.
Don't forget to UseCodeTags (<- link) when posting actual code to make your code readable. Thank you.
The basic game contains 2 copies of 26 different images that we place in a field( 4 lines, 13 columns). The game can be played by a player(count his steps-opening pairs) or by a team (when someone find a pair he playes again). Now we have some variatios :
1) Someone who found a pair doesn't play again, but continues the next one (team game only).
2)Double game (2 copies of 52 different images) in field( 8 x 13).
3)Trio-quartet, we have 3/4 copies in 26 different images.
4) We place the cards in random ( no field).
5)Someone in team game decides not to play.
6)When we open a pair, the cards change places.
7)The pairs,trio,quartet are opened in order, a number is written at the image.
8)Battle, only two players who play in two fields(4 x 13), one for each one. Each field contains 52 different pictures -like double game. Each player can open cards only from his field. One of them begin opening a card and the other one responds . If the two cards are similar, the second one wins the pair. Then the first player is changed.
Finally, when we have more than one player, one of them can be controlled by computer with 3 memory levels( a(goldfish)-> remember nothing, b(kangaroo)-> remember the half, c(elephant) -> remember everything )
Interfaces : DoubleGame, TrioQuartet, Battle, OpenCardsInOrder
A parent class Player and children Single,Team
Classes field and image.
[HENRY: fixed code tags]
Wow. That game has a large number of game modes and features. Do you really need to work through (have a plan) for all the game modes and features before you can start development?
Christina Tzogka wrote:I don't ask for code, i would try to do it by myself, i only need a plan for the classes and the methods... help me guys, it's too difficult !!
How about narrowing it down to one mode and one feature first? And with that, how about narrowing it down to a small subset of that? etc. It looks difficult because it is a lot. Plan out a small piece at a time.
Christina Tzogka wrote:Henry, my project is separeted in two parts. In the first i must send only the classes and the methods without code so i should have a complete plan. I tied to narrow it down but i got confused again. I asked for help for the basic game but i wrote the assignment so you can get a idea for the whole project...
As Liutauras mentioned, please tell us what you did so far, and where are you stuck (confused). We can't give you any hints in the right direction, if we don't know what issues you are having.
Sorry for a late reply. I hope your assignment due date isn't by the end of Monday.
Christina Tzogka wrote:my project is separeted in two parts. In the first i must send only the classes and the methods without code so i should have a complete plan.
Lets start by bringing some clarity into it. The problem is intepretations (these usually are wrong). Please post exact assignment requirements, then tell us what do you think, how the first part of your assignment should be looking like and we can strat from there.
I tried to translate exactly the assignment because it is greek. Let's start with the basic game. It can be played by 1 player or a team ( i think i need a parent class Player and children Single-Team). I have also creat a class Board with the list of the cards and some methods ( you can see the code some post before ). Now i don't know how to connect Player with Board, viz how a player could start the game.
Stop wandering. What have you got here? In which form these should be sent? *.java files or diagram?
Christina Tzogka wrote:my project is separeted in two parts. In the first i must send only the classes and the methods without code
From the previous code you posted I see you provided defined methods implementations, does that mean you submitted first part already?
I will send .java files.
No, it is only something i found in google about memory game with cards, i only add cards in list. Of course i didn't submitted the first part because all i send you are only thoughts.
The basic game contains 2 copies of 26 different images that we place in a field( 4 lines, 13 columns).
This tells us you need images and a field. It looks like you have Card and Board, which is fine.
The game can be played by a player(count his steps-opening pairs) or by a team (when someone find a pair he playes again).
So you need a Player class and maybe a Team class. You probably need a Game class that lets a Player pick to cards and records when they're fliped and when the game ends.
Now what do you need in a Card class? You need an image, probably represented by an imageFileName field. If the imageFileNames of the two cards equal, you have a match, so you probably should override the equals() method in Card. The Card will need to know when it's flipped.
Are you getting the process here? Try to carry on and fill out what I've started.
Christina Tzogka wrote:Ok, so in that way i can creat TrioQuartet,Battle( variation 8. from assignment) that also implement Game ?
I would think so. The nice thing about implementing an interface is that if you use Game as the type of variable, you know that certain behavior is shared. For instance, maybe you would have a method called endGame(). You would know there is this method for all implementations, although how the game end may be different.
Also, how i could separate the person player from the player who is controlled by computer (i mentioned it in the assignment) ? I will need another class but Player ?
You could again use a Player interface and implement LivePlayer and ComputerPlayer. Now you could have a method like getMove() and it would be implemented differently for the two kinds of Player.
Knute Snortum wrote:I'm not sure this is the best advice for a beginner. They should learn to build and use classes as much as possible for all but the simplest programs (three or four lines). Classes are much easier to debug and maintain and once you get the hang of it, and I think they are easier to program with too.
I generally agree with what you're saying, just for specifically the card and board I don't like creating classes. The project as a whole should have several other classes and give plenty of practice.
Christina Tzogka wrote:Ok, so in that way i can creat TrioQuartet,Battle( variation 8. from assignment) that also implement Game ? Also, how i could separate the person player from the player who is controlled by computer (i mentioned it in the assignment) ? I will need another class but Player ?
I think you're getting a bit bogged down in the "how" already, when what you should be focusing on is the "what".
And a big hint is that they've asked you for classes and some method signatures, but no code.
Here's my tips: