Two Plus Two Poker Forums Help me please! Programming assignment!
 Register FAQ Search Today's Posts Mark Forums Read Video Directory TwoPlusTwo.com

 Notices 2013 Two Plus Two Party at South Point BET RAISE FOLD screening at 3PM in lounge next to poker room. July 6th Party registration at 5PM. Food served at 6PM

 08-03-2012, 05:57 AM #1 grinder     Join Date: Mar 2012 Posts: 437 Help me please! Programming assignment! Hi everyone! Can someone guide me on this assignment? I am lost and do not know how should I start. Mine teacher didn't taught me on 2D array. I myself went to get a book on Adobe Flash Cs4 Professional bible to guide me. But yet I still do not know how to get started. Any comments are welcomed. Be it bad or good! This is the question. Write a program to simulate a simplified version of Connect 4. Connect 4 is a two player game played on a 6x6 game board, where the objective is to drop circular pieces into 6 column slots. The winner is decided when one of the two computer players is able to get 4 circular pieces together horizontally or vertically. This modified version of Connect 4 will be simulated using two computer players. Assume there is no user input for this game. The 6x6 board will be simulated using a 6 x 6 2D array. At the start, the game must randomly decide which computer player (1 or 2) will go first. Then, the program should simulate the game play as follows: • At each turn, the current state of the game board should be displayed • At each turn, each computer player randomly drops a circular piece into one of the 6 column slots. The column to be dropped into must be randomly decided. Each column slot can only take a maximum of 6 pieces. Then, when a circular piece is dropped in, it will go into a position in that column, which has a x and y value (e.g. [2][2]). If that column is full, then the computer player skips the turn. • After each circular piece is dropped, the program must check if that computer player has won or not. A win means that after that drop there is either a horizontal or vertical group of 4 circular pieces on the game board. • If there is no winner, then at the end of the turn, the updated state of the 6x6 2D game board should be displayed. Overall, each position (or slot) in the displayed 6x6 2D game board can contain any of the following: • -1 -> not occupied yet • 1 -> occupied by computer player 1’s circular piece • 2 -> occupied by computer player 2’s circular piece The game ends when one of the following conditions is satisfied: • Either computer player 1 or 2 has a horizontal or vertical group of 4 pieces on the game board. If this condition is satisfied the program should print that computer player as the winner. • There are no more slots in the game board to drop pieces onto. Then, the program should print “No winner” as output. Your program must, at least, include the following methods/functions with the correct input parameters and output type: i. initializeGameBoard, which will take as input the player’s 2D array and assign blank slots containing -1 (-1 is assumed to be unoccupied yet). ii. dropPiece, which will drop a circular piece randomly into a slot in one of the six columns. Your program also needs to track and print the following: • Number of pieces dropped into each column by computer player 1 • Number of pieces dropped into each column by computer player 2 Marks will be awarded for further making your program modular. You must carefully choose the methods. Sorry and thanks! Got 3 days to design a something out. Guide me. I am willing to do anything!
08-03-2012, 11:16 AM   #2
Carpal \'Tunnel

Join Date: Jun 2006
Location: 39, 46, 56, 59, 191
Posts: 39,962
Re: Help me please! Programming assignment!

Quote:
Quote:
 I myself went to get a book on Adobe Flash Cs4 Professional bible to guide me. But yet I still do not know how to get started.
WTF

I guess that's a bad comment.

A 2d array is something like this [[-1,-1,-1],[-1,-1,-1]] you didn't even say what programming language you're supposed to solve this in.

I don't think anyone here will do your homework for you. It's pretty unethical and all.

08-03-2012, 11:27 AM   #3
Carpal \'Tunnel

Join Date: Sep 2004
Posts: 10,256
Re: Help me please! Programming assignment!

Quote:
 Originally Posted by clowntable WTF
I'm glad I wasn't the only one who read that and thought the same!

Juk

 08-03-2012, 01:46 PM #4 adept   Join Date: Jul 2007 Posts: 1,008 Re: Help me please! Programming assignment! Programming language? Do you need to make a GUI? You should really try doing something and ask more specific questions on the way, then people will help you.
08-03-2012, 05:04 PM   #5
grinder

Join Date: Mar 2012
Posts: 437
Re: Help me please! Programming assignment!

I am really sorry.

Programming language is Action script.

I just need someone to guide me on what to do first and stuff like this. Not giving me the code for the solution.

Quote:
 Do you need to make a GUI?
Nope. I just have to create a solution that's all.

Quote:
 A 2d array is something like this [[-1,-1,-1],[-1,-1,-1]]
A array is = [a]

Can I also say that a 2d array is like this?

[[a],[a]]

08-03-2012, 05:34 PM   #6
bacon wannabe

Join Date: Sep 2004
Posts: 17,057
Re: Help me please! Programming assignment!

Quote:
 Originally Posted by Tarkyo Programming language is Action script. I just need someone to guide me on what to do first and stuff like this. Not giving me the code for the solution.
Switch classes

 08-04-2012, 12:59 AM #7 grinder     Join Date: Mar 2012 Posts: 437 Re: Help me please! Programming assignment!
 08-04-2012, 02:49 AM #8 grinder     Join Date: Sep 2011 Location: United States Posts: 9999999 Posts: 535 Re: Help me please! Programming assignment! What classes have you already had? I'm just curious if this is your first class in programming and your first project. To only have 3 days is kind of rough, actionscript is kind of useless because flash is dead (imo), and you can't break down the steps yourself? You need to build a multidimensional array, use a function for random number for who goes first, then use the random function for which column the player chooses, make a function that checks when a player has 4 in a row or column or diagonal. It seems like a fun homework assignment but I'm confused on why you don't have any of the above attempted.
08-05-2012, 05:19 AM   #9
journeyman

Join Date: Apr 2011
Posts: 366
Re: Help me please! Programming assignment!

Quote:
 Originally Posted by iosys actionscript is kind of useless because flash is dead (imo)
Don't pay any attention to this. There are a lot of people who like to go around proclaiming things dead when they are far from it. Let's just be glad they didn't choose to become doctors.

08-05-2012, 12:37 PM   #10
grinder

Join Date: Sep 2011
Location: United States Posts: 9999999
Posts: 535
Re: Help me please! Programming assignment!

Quote:
 Originally Posted by Akhanar Don't pay any attention to this. There are a lot of people who like to go around proclaiming things dead when they are far from it. Let's just be glad they didn't choose to become doctors.
There is a reason why i had, "imo" in the sentence, the flash player is filled with memory problems, and I did enjoy flash a ton growing up.

I'm actually disappointed the way it has become but whatever spew out your mouth.

08-05-2012, 02:15 PM   #11
grinder

Join Date: Mar 2012
Posts: 437
Re: Help me please! Programming assignment!

Quote:
 What classes have you already had? I'm just curious if this is your first class in programming and your first project. To only have 3 days is kind of rough, actionscript is kind of useless because flash is dead (imo), and you can't break down the steps yourself? You need to build a multidimensional array, use a function for random number for who goes first, then use the random function for which column the player chooses, make a function that checks when a player has 4 in a row or column or diagonal. It seems like a fun homework assignment but I'm confused on why you don't have any of the above attempted.
Okay to be honest. The 3 days deadline was actually for myself to finish my work so I am able to check and write a report about it.

The real deadline is actually this coming Friday.

While and For loops, generating random numbers,variables, data-type, selections, operators, expressions, array( NO 2D array at all!) and functions.

Yes, because I don't really understand the question well.

Quote:
 You need to build a multidimensional array, use a function for random number for who goes first, then use the random function for which column the player chooses, make a function that checks when a player has 4 in a row or column or diagonal.
Alright will check that up and try to make something like what you said and post it here in a few hours.

I am truly grateful!

08-06-2012, 12:44 AM   #12
journeyman

Join Date: Apr 2011
Posts: 366
Re: Help me please! Programming assignment!

Quote:
 Originally Posted by iosys There is a reason why i had, "imo" in the sentence
Putting "imo" after something does not excuse you from stupid comments. Mexicans are all lazy and dirty (imo). Does it sounds any less ignorant? no.

In fact, putting "imo" after something is completely redundant if not nonsensical. Saying "I believe that X" is exactly equivalent to just saying "X." You don't need to add the extra part that you believe what you are saying to be true or that what you are saying is your opinion. This is self evident.

You seem to be one of those people who does not understand the difference between an opinion and a belief. You cannot have an opinion about whether or not "Flash is dead." You can have an opinion about whether or not broccoli tastes good. You can have an opinion about whether or not Jazz is the best kind of music. You can even have an opinion about whether ActionScript is more fun to use than Java. But you cannot have an opinion about whether or not Flash is dead. Because it implies a universal which applies to everyone, this is the type of thing you can have a belief about, not an opinion. Unlike opinions, beliefs can be wrong, and unlike opinions (which everyone is entitled to regardless of what it is) people are not entitled to their beliefs. Beliefs do not carry with them any sort of entitlement. Sure, people often say "you are entitled to your beliefs" but these are people like you who don't know the difference between opinions and beliefs.

@Tarkyo: Why don't you go ask the instructor for help? That's his job. Doesn't he hold office hours or something? Does he have an email address?

Last edited by Akhanar; 08-06-2012 at 12:56 AM.

08-06-2012, 04:00 AM   #13
grinder

Join Date: Mar 2012
Posts: 437
Re: Help me please! Programming assignment!

Quote:
 @Tarkyo: Why don't you go ask the instructor for help? That's his job. Doesn't he hold office hours or something? Does he have an email address?
Wanted to. But he declined as this is a graded assignment and everyone in the class is doing it. So yeah.

08-06-2012, 11:45 AM   #14
grinder

Join Date: Sep 2011
Location: United States Posts: 9999999
Posts: 535
Re: Help me please! Programming assignment!

Quote:
Actually yes I can have an opinion on it because I do and I actually believe it.

I can understand why you wish it wasn't so, but I can't understand why you care to change my stance on it.

If I feel it's necessary to warn him that he should do some research on where flash is headed, I'm not going to care if someone like you, will say something stupid, "glad he isn't a doctor" because people like you are why nothing in this world changes.
People should just shut their mouth and watch other people do what they disagree with in your "perfect world".

Many colleagues feel the same way I do, of course there are people that think it will survive and guess what... adobe doesn't want it to die too!
They made such a push for 3d games or something (last I check) which I find humorous because flash could of been so much more, if it wasn't for many factors I'm not going to list. (you go do some research because you need to)

I will say, I wouldn't of posted my comment if I wasn't so fed up with the damn player crashing. I know many people, including myself that have very high end desktops, and run into constant memory errors.

Anyway good luck with your flash poker site.
Really not trying to spit on your language but I just feel like adobe screwed up and it's going down down down down hill!

 08-06-2012, 01:03 PM #15 grinder     Join Date: Mar 2012 Posts: 437 Re: Help me please! Programming assignment! Question. The multidimensional array is for? Sorry!

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are Off Pingbacks are Off Refbacks are Off Forum Rules

All times are GMT -4. The time now is 10:18 AM.

 Contact Us - Two Plus Two Publishing LLC - Privacy Statement - Top