Results 1 to 3 of 3
Thread: New to Java need help
- 11-15-2011, 03:28 AM #1Member
- Join Date
- Sep 2011
- Rep Power
New to Java need help
Hello, I need help on a Connect Four project and just wanted to know if anyone could help me out.
Thanks! This is the directions to the project:
You will create a program that simulates the game of Connect Four using arrays and tokens. Your board will be an array with the dimensions of 6x7. Player one and player two tokens are to be selected by the programmer i.e. “@”, “O”, “+”, “” etc. It is up to you whether to make the game player vs. player, player vs. computer.
The winner of the Connect Four will be the first player to get four of his or her same token pieces in a row horizontally, vertically or diagonally.
The program should work as follows:
1. During their turn, allow each player to select a column to play.
(Possible chance to use switch statement)
2. Once a column is selected the program should review the column and place that player’s token at the bottom most available location.
3. Program should have input validation to make sure user inputs a valid position on the board.
4. Program should include input validation to verify if a column or location is already full.
(Do not allow overwriting of tokens)
5. Program should have a check system set up to verify if a player has gotten 4 of his or her tokens in a row.
6. If all 42 positions of the board are filled, the program should declare a draw.
7. Program should allow users to continue playing games until they decide to quit.
8. Program should keep track of wins, losses and draws.
9. Program should account for all possible ways to win. In total there are 69 patterns of 4 tokens in a row to win.
• 24 Horizontal
• 21 Vertical
• 24 Diagonal
*For extra credit let the player chose to play against the computer or another player.
*Also you can let the players enter in their own tokens.
Re: New to Java need help
What you've done is to post your entire assignment without showing what work you've done, without asking a specific question, and that is not how to get help here (or at any forum). For one, we have no idea what you're having trouble with, so we won't know how to advise you. For another, if you don't at least try to solve what you can first, you're cheating yourself out a valuable part of your learning experience, and finally it suggests that you want someone to post a complete solution, thereby doing your homework for you, and I know that this was not your intent.
So please try to solve as much of the problem that you can first, then post what you've done using code tags (see my signature), and then ask a specific question. Do this and you'll have many folks willing to help you.
Re: New to Java need help
Also, please read my recommendations in your previous post here. They remain just as valid as ever.
Writing a good answerable question in a forum is a skill that will get better with time and effort, so don't give up and keep trying with both the Java and the questions. You'll get there if you put in the effort and have the desire.