Want help in developing my first game in java!!

I want to develop a tetris game in java..can any one help me on this..basically i m new to java programming, i want to know abt the graphical part ..how to make that.. i will code the rest..I want to make an application rather than an applet..

look at the Java2D demo that comes with the JDK
it has lots of source code and just about everything you'll need to do in Tetris (technology wise) is in there, except the game logic.
when you're ready to move into 3D and heavier apps, try this book:
Practical Java Game Programming
http://www.amazon.com/exec/obidos/tg/detail/-/1584503262/102-3570681-1096110?v=glance

Similar Messages

  • Want help in producing my first CD

    Close to finishing my first CD (about a year-and-a-half in the making). Used GarageBand 2; Band-in-a-Box 12, Sound Studio 2.1, Audacity 1.2.6 and Cubase LE 1.0.7 to get it all done. Running Panther.
    Does anyone out there have suggestions regarding an on-line site that will do all of the following:
    • Duplicate CDs (I’ll be wanting about 200);
    • Design, print (color) and fold CD case jackets;
    • Print design on the CDs;
    • Provide cases for the CDs.
    In other words, do it all... with my input, especially on design.
    Note: My CDs are only for personal use, to share with family and friends. Not to market.

    look at the Java2D demo that comes with the JDK
    it has lots of source code and just about everything you'll need to do in Tetris (technology wise) is in there, except the game logic.
    when you're ready to move into 3D and heavier apps, try this book:
    Practical Java Game Programming
    http://www.amazon.com/exec/obidos/tg/detail/-/1584503262/102-3570681-1096110?v=glance

  • I want help regarding developer suite of gemalto framework

    I am trying to run the java card epurse example given in the developer suite of gemalto framework.And in that code if i try to modify the code for converting byte data into decimal , then its showing error in the .gbp file.
    Kindly help me out if anyone has any idea about what this problem is.

    it doesnt show any error msg ..its jus that a red cross of error appears on the .gbp file.and if we still try to run it then error msg - "error exists in following project" displays.

  • How do I know games and programs that become free? I want to know the programs and games that become free first first

    How do I know games and programs that become free?
    I want to know the programs and games that become free first first

    You are allowed to have two activated installations so there should not be a problem having working installations on the two machines.  If by chance you have somehow tied up two activations for the one machine you can have Adobe support help resolve that thru chat.
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • HT5622 I am trying to buy some help on the "candy crush" game but I keep getting this pop-up" unable to purchase. This item is for an app that was purchased by a different Apple ID. to buy this item with this Apple ID you must first purchase the app. My d

    I am trying to buy help on my candy crush game but I keep getting this pop-up? Unable to Purchase. This item for an app that was purchased by a different Apple ID. To buy this item with this Apple ID, you must first purchase the app. My daughter set up this game on my Iphone. I am on level 65 and don't wont to start over if I don't have to.
    Any suggestions?

    If it was indeed purchased with a different apple ID then there is no work around for what you want! You can try signing in with your daughter's apple ID and password and update the app and purchase whatever you want then log back in with your apple ID. This may work!

  • Need help with developing a small pool game

    Hi,
    I want to develop a small pool game ....Im using the netbeans ide and ....what I have so far is 2 classes ......Pool and GUI
    Basically the main method is in the Pool class.......withing main I created a new GUI object .....which in turn creates a frame.
    I now want to custom code a rectangle and make it a container for the pool table and also colour it......the thing is can I do animations in a frame and by using independant classes rather than using an applet?
    I know this may be innefficient but I want to create a standalone pool game that uses custom objects and classes for the various tasks. I was just wandering if it was possible to do drawings the way i am saying without using an applet? Its just all the tutorials I see .....well all the code seems messy and lumped together in the one place ....and I basically want things such as a independant ball class and perhaps a painter custom interface that colours rectangles.
    Any advice would be appreciated
    David

    Thanks for the advice .....The thing is I understand pretty well what is needed .....and I have programmed small applications that take bookings for a hotel and and a library ....Im am familiar with references, arraylists and the alike and im also reading about the java collections interface ......I have also coded a simplistic program in the past that basically a ball was bouncing of the sides of a container and made a sound when it hit the edge(this used threads i believe). However it has been a while ......and although I am happy with some of the concepts of java........we did not do any java graphics programming at college. In all fairness though I learned the importance of using classes properly and in a way thats why im finding it so difficult to code even basic graphic movement that Im happy with as the tutorials Ive seen have everything lumped in one place(as mentioned) and trying to make them more modular can be difficult. As far as I know from coding some basic applets they are generated on the client side to enable everyone with different platforms to view stuff over the web. I dont want applets as I dont at this time want to distribute any of my meager programs over the web :-)). It is good to know that I can use threads and such independent of the applet class........I know my question may be naive but 100% of the tutorials I saw invoked the applet class in some way and emplied in a way that it was essential.......I thought there would be a way to do it without using applets but was not 100% sure which is why I asked.
    I will just need to try and find one guide now that actually shows me how to do what im asking:-)
    Cheers
    David
    I also have 3 java books.......each of which concentrate on graphics by use of applets ....im going to look them out again as they might contain something useful .....to be honest though they were a bit of a waste of money lol(well 2 of them were)

  • Need Help For Developing Java Network RPG

    Greetings,
    Did anyone develop any similar game?I'm developing one for my final year project and i need some guidelines on that.
    Thanks for your help in advanced.
    Cheers,
    yc

    Since you are making a 2D game I suppose that speed is not really important. Don't make it too hard on yourself and use objectstreams.
    first thing you need is a class which holds all the variables you want to send (like position, health, whatever) and let it implement the "Serializable" interface.
    next stop: the client side connection
    socket     = new Socket(ipaddress, port);     
    obi = new ObjectInputStream(socket.getInputStream());
    obu = new ObjectOutputStream(socket.getOutputStream());and the server side connection:
    ServerSocket s = new ServerSocket(port);
    while(true) { // keep accepting new connections
    socket = s.accept();
    obu = new ObjectOutputStream(socket.getOutputStream());
    obi = new ObjectInputStream(socket.getInputStream());
    }make sure you turn around output and input. The server won't continue unless his output has input on the clientside.
    with the objectoutputsstream you can send the objects:
    obu.writeObject(netData);
    obu.flush();
      // make sure you flushreceiving the object:
    netData = (YourNetData) oi.readObject();so what you need is a client side function that sends objects, a client side thread that handles received objects.
    The easiest way to make a server is making an array of client threads and put the socket and the objectstreams in the thread. The thread can read an incoming object and send it to all clients in the array. This way you never have to change your server, you only have to change the object you send.

  • Can I make a Living by developing apps and games for iOS??

    Well, I want to be an iOS developer. I'm a beginner. I just want to know if I could make a living just by developing apps and games for iPhones and iPads?? In about next 5 years, I'll be able to submit my first game. I have my own problems. But can I make a living??

    Some devs do quite well, others find it barely worth the effort. Anything is possible, but as noted, it all depends on you.

  • HELP PLEASE: How to change game centre ID to new iPad Air??

    This is my first post so I hope I've put it in the right area?
    My partner originally had the iPad I currently use, which is an iPad2.
    He created a Game Centre profile and every game I have downloaded from the App store has gone under 'his' Game Centre Profile BUT using 'my' Apple ID & password.
    I'm getting a new iPad Air today and want to transfer EVERYTHING to my OWN Game Centre profile and DO NOT want to risk losing all my games on the iPad 2!!
    1. If I delete his Game Centre profile do I risk mucking up or losing my games on the iPad 2?
    2. Can I merge the two Game Centre accounts?
    3. What do I do?
    I was told his Game Centre account was linked via iCloud so I deleted that, but still his Game Centre account keeps on popping up on the iPad 2.
    I'd really appreciate anyone's help on this, who is far more experienced than I am because I really don't want to lose my games that I've been playing for a number of years
    End result:  I want ALL my games on the iPad 2 onto my new iPad Air under my own Game Centre account.
    Any help would be appreciated.
    Thank you.

    Any ideas anyone on what I need to do re; above and the Game Centre??
    I really want to try and swap everything over today, if I can, without losing anything.

  • Help Needed to Write Nim Game

    I need help in writing the Nim game. I have the program written already for the user to select if they want to go first or the computer and how many stones the user wants to start with. The problem I am having is writing a loop that recognizes which player is to go first and executes the play of taking stones. Any help would be appreciated.

    Perhaps there could be a boolean firstPlayerMove. Then, when the loop starts, if that is true then the first player enters the stones, otherwise second player. At the end of every time the loop is executed firstPlayerMove should equal "!firstPlayerMove."

  • Need help to develop app to remotely add tags to iTunes music from iPhone

    Hi
    I have recently developed a simple app that sits on my desktop and allows me to add specific tags/text to the 'comment' field of the currently playing track in my iTunes library, the text added depending on the item clicked in some drop-down menus.
    This is fine for when I am sitting at my Mac, but most of the time I would like to be able to add tags from a distance, i.e. remotely, using the iPhone, so I started to develop my first iPhone app for this purpose.
    I have succesfully designed a simple Tab Bar Application, with two views, which have all the buttons I need, but now I am stumped as to how to set up the remote part of the app. On the Desktop version I simply wrote some applescript with sections for each of the menu items. On the iPhone I am not sure how I would go about this.
    Any help with this, either with the procedure I need to follow, or pointing me in the right direction of a tutorial or some such thing, would be gratefully received.
    thanks
    nick.

    Do you mean write access to the iTunes library, rather than iPod library?
    If so, if I can accomplish my task with getting the iPhone app to interact with the Desktop app that would be fine. However, I have no idea of how to go about this. Can you give me any pointers?
    The desktop app basically consists of a few drop down menus with items that are linked to sections in the project's applescript, which tell iTunes to add specific text to the comments field.
    Thanks
    Nick

  • Need help to develop a custom connector

    I need some help on developing the custom connector to Homegrown application and the version i am using is OIM9.0.3
    First of all what are the steps do we need to care while developing a custom connector.
    I can't able to find the process in google to develop the custom connector.
    If you have any data regarding the development of custom connector, plz share to me....
    What are the thing do we need to take care while developing the connector.
    I referred in OIM9.1 version there was an option to develop the Custom connector by using Genric technology, can we create the custom connector by using the GTC feature in OIM 9.1
    early response will be appreciated

    The docs for the new GTC framework are here: http://download.oracle.com/docs/cd/E10391_01/doc.910/e10360/about.htm#Toc153968019. GTC is useful if you target application exposes standards-based SPML (Service Provisioning Markup Language) user management interfaces, although it sounds like this isn't the case for you.
    You will most likely need to go the traditional route in terms of connector development, which involves building OIM Process Task Adapters to invoke the application API's (I assume they're Java?) and invoking those adapters from within an OIM Provisioning Process.
    Rob

  • Urgent Help Required for Connect Four Game

    Hi all,
    I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
    Sorry there is so much code.
    This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
    Interface code..............
    interface Player {
    void init (Boolean color);
    String name ();
    int move ();
    void inform (int i);
    Player1 class......................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player1 implements Player
    public Player1()
    public int move()
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player1;
    System.out.println ("What is your Number, player 1?");
    player1 = scan.nextInt();
    System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
    System.out.println();
    return player1;
    //Player.move();
    //return player1;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "Koonda";
    }//end player1 class
    Player2 class...........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player2 implements Player
    public int move()
    //int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    // cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    //int num1, num2;
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player2;
    System.out.println ("What is your Number, player 2?");
    player2 = scan.nextInt();
    System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
    System.out.println();
    //return player1;
    return player2;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "malook";
    }//end player1 class
    PlayGame class which contains all the functionality.........................................................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class PlayGame
    //Player player1;
    //Player player2;
    int [][]ConnectFourArray;
    boolean status;
    int winner;
         int player1;
         int player2;
         public PlayGame()
              //this.player1 = player1;
              //this.player2 = player2;
         public void StartGame()
         try{
         // int X = 0, Y = 0;
         //int value;
         int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
         int[][] ConnectFourArray = new int[6][7];
         int num1, num2;
         for(int limit=21;limit!=0;limit--)
    BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
    String column1;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=1;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=1;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=1;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=1;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=1;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=1;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=1;
    cup6=cup6-1;
    System.out.println();
    BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
    String column2;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=2;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=2;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=2;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=2;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=2;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=2;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=2;
    cup6=cup6-1;
    System.out.println();
    System.out.println();
    catch (Exception E){
    System.out.println("Error with input");
    System.out.println("Would you like to play again");
    try{
    String value;
    BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
    // Scanner scan = new Scanner(System.in);
    System.out.println("Enter yes to play or no to quit");
    // value = scan.nextLine();
    // String value2;
    value = reader.readLine();
    //value2 = reader.readLine();
    if (value.equals("yes"))
    System.out.println("Start again");
    StartGame(); // calling the StartGame method to play a game once more
    else if (value.equals("no"))
    System.out.println("No more games to play");
    // System.exit(0);
    else
    System.exit(0);
    System.out.println();
    catch (Exception e){
    System.out.println("Error with input");
    finally
    System.out.println(" playing done");
    //StartGame();
    //check for horizontal win
    public int hasWon()
    int status = 0;
    for (int row=0; row<6; row++)
    for (int col=0; col<4; col++)
    if (ConnectFourArray[col][row] != 0 &&
    ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
    //status = true;//int winner;
    if(status == player1)
    System.out.println("Player 1 is the winner");
    else if(status == player2)
    System.out.println("Player 2 is the winner" );
    }//end inner for loop
    }// end outer for loop
    } // end method Winner
    return status;
    }//end class
    ClassConnectFour which designs the board........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class ClassConnectFour
         //Player player1;
         //Player player2;
         public ClassConnectFour()
              //this.player1 = player1;
    public void DrawBoard()
    int[][] ConnectFourArray = new int[6][7] ;
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    }//end class
    TestConnetFour class which uses most of the above class..................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class TestConnectFour
    public static void main(String[] args)
    ClassConnectFour cf = new ClassConnectFour();
    cf.DrawBoard();
    Player1 player1 = new Player1();
    Player2 player2 = new Player2();
    player1.move();
    player2.move();
    System.out.println("Number 1 belongs to player " + player1.name());
    System.out.println("Number 2 belongs to player " + player2.name());
    PlayGame pg = new PlayGame();
    pg.StartGame();
    pg.hasWon();
    //pg.Play();
    //System.out.println(player.name());
    //System.out.println(player2.name());
    }// end main
    }//end class
    I am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
    Thanks in advance.
    Koonda
    //

    Hi,
    Thanks for your help but I really don't understand the table lookup algorithm. Could you please send me some code to implement that.
    I will send you the formatted code as well
    Thanks for your help.
    looking forward to your reply.
    Koonda
    Hi all,
    I am a student and I have a project due 20th of this month, I mean May 20, 2007 after 8 days. The project is about creating a Connect Four Game. I have found some code examples on the internet which helped me little bit. But there are lot of problems I am facing developing the whole game. I have drawn the Board and the two players can play. The players numbers can fill the board, but I have problem implementing the winner for the game. I need to implement the hasWon() method for Horizontal win, Vertical win and Diagonal win. I also found some code examples on the net but I was unable to make it working. I have 5 classes and one interface which I m implementing. The main problem is how to implement the hasWon() method in the PlayGame class below with Horizontal, vertical and diagonal moves.
    Sorry there is so much code.
    This the interface I must implement, but now I am only implementing the int move() of this interface. I will implement the rest later after solving the winner problem with your help.
    Interface code..............
    interface Player {
    void init (Boolean color);
    String name ();
    int move ();
    void inform (int i);
    Player1 class......................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player1 implements Player
    public Player1()
    public int move()
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player1;
    System.out.println ("What is your Number, player 1?");
    player1 = scan.nextInt();
    System.out.println ("Hey number"+player1+" are you prepared to CONNECT FOUR");
    System.out.println();
    return player1;
    //Player.move();
    //return player1;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "Koonda";
    }//end player1 class
    Player2 class...........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class Player2 implements Player
    public int move()
    //int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    // cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    //int num1, num2;
    Scanner scan = new Scanner(System.in);
    // BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
    int player2;
    System.out.println ("What is your Number, player 2?");
    player2 = scan.nextInt();
    System.out.println ("Hey "+player2+" are you prepared to CONNECT FOUR");
    System.out.println();
    //return player1;
    return player2;
    }//end move method
    public void init (Boolean color)
    public void inform (int i)
    public String name()
    return "malook";
    }//end player1 class
    PlayGame class which contains all the functionality.........................................................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class PlayGame
    //Player player1;
    //Player player2;
    int [][]ConnectFourArray;
    boolean status;
    int winner;
    int player1;
    int player2;
    public PlayGame()
    //this.player1 = player1;
    //this.player2 = player2;
    public void StartGame()
    try{
    // int X = 0, Y = 0;
    //int value;
    int cup0,cup1,cup2,cup3,cup4,cup5,cup6;
    cup0=5;cup1=5;cup2=5;cup3=5;cup4=5;cup5=5;cup6=5;
    int[][] ConnectFourArray = new int[6][7];
    int num1, num2;
    for(int limit=21;limit!=0;limit--)
    BufferedReader selecter = new BufferedReader (new InputStreamReader(System.in));
    String column1;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=1;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=1;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=1;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=1;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=1;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=1;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=1;
    cup6=cup6-1;
    System.out.println();
    BufferedReader selecter2 = new BufferedReader (new InputStreamReader(System.in));
    String column2;
    System.out.println();
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    System.out.println ("Please Select a column of 0 through 6 ");
    column1 = selecter.readLine();
    num1= Integer.parseInt(column1);
    System.out.println();
    if (num1==0){
    ConnectFourArray[cup0][0]=2;
    cup0=cup0-1;
    else if (num1==1){
    ConnectFourArray[cup1][1]=2;
    cup1=cup1-1;
    else if (num1==2){
    ConnectFourArray[cup2][2]=2;
    cup2=cup2-1;
    else if (num1==3){
    ConnectFourArray[cup3][3]=2;
    cup3=cup3-1;
    else if (num1==4){
    ConnectFourArray[cup4][4]=2;
    cup4=cup4-1;
    else if (num1==5){
    ConnectFourArray[cup5][5]=2;
    cup5=cup5-1;
    else if (num1==6){
    ConnectFourArray[cup6][6]=2;
    cup6=cup6-1;
    System.out.println();
    System.out.println();
    catch (Exception E){
    System.out.println("Error with input");
    System.out.println("Would you like to play again");
    try{
    String value;
    BufferedReader reader = new BufferedReader (new InputStreamReader(System.in));
    // Scanner scan = new Scanner(System.in);
    System.out.println("Enter yes to play or no to quit");
    // value = scan.nextLine();
    // String value2;
    value = reader.readLine();
    //value2 = reader.readLine();
    if (value.equals("yes"))
    System.out.println("Start again");
    StartGame(); // calling the StartGame method to play a game once more
    else if (value.equals("no"))
    System.out.println("No more games to play");
    // System.exit(0);
    else
    System.exit(0);
    System.out.println();
    catch (Exception e){
    System.out.println("Error with input");
    finally
    System.out.println(" playing done");
    //StartGame();
    //check for horizontal win
    public int hasWon()
    int status = 0;
    for (int row=0; row<6; row++)
    for (int col=0; col<4; col++)
    if (ConnectFourArray[col][row] != 0 &&
    ConnectFourArray[col][row] == ConnectFourArray[col+1][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+2][row] &&
    ConnectFourArray[col][row] == ConnectFourArray[col+3][row])
    //status = true;//int winner;
    if(status == player1)
    System.out.println("Player 1 is the winner");
    else if(status == player2)
    System.out.println("Player 2 is the winner" );
    }//end inner for loop
    }// end outer for loop
    } // end method Winner
    return status;
    }//end class
    ClassConnectFour which designs the board........................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class ClassConnectFour
    //Player player1;
    //Player player2;
    public ClassConnectFour()
    //this.player1 = player1;
    public void DrawBoard()
    int[][] ConnectFourArray = new int[6][7] ;
    for ( int row=0; row < ConnectFourArray.length; row++ ){
    System.out.print("Row " + row + ": ");
    for ( int col=0; col < ConnectFourArray[row].length; col++ )
    System.out.print( ConnectFourArray[row][col] + " ");
    System.out.println();
    System.out.println();
    }//end class
    TestConnetFour class which uses most of the above class..................
    import java.util.*;
    import java.io.*;
    import javax.swing.*;
    public class TestConnectFour
    public static void main(String[] args)
    ClassConnectFour cf = new ClassConnectFour();
    cf.DrawBoard();
    Player1 player1 = new Player1();
    Player2 player2 = new Player2();
    player1.move();
    player2.move();
    System.out.println("Number 1 belongs to player " + player1.name());
    System.out.println("Number 2 belongs to player " + player2.name());
    PlayGame pg = new PlayGame();
    pg.StartGame();
    pg.hasWon();
    //pg.Play();
    //System.out.println(player.name());
    //System.out.println(player2.name());
    }// end main
    }//end classI am sorry for all this junk code but I only understand it this way. Your urgent help is required. Looking forward to your reply.
    Thanks in advance.
    Koonda

  • I have a new apple ID but if i want to buy music or free games in the apps store but they want me to log on my old iD and password but is not working anymore please give me a solution how to delete my old apple ID.

    How to delete my old apple ID? If i want to buy musics or free games in the apps store ,the old ID still show up to sign me but is not working anymore.please help!

    Go to settings, iTunes &amp; App Store, tap on your ID, sign out, then sign in with your new information. You cannot delete an old ID, you just stop using it.

  • I have money in my account, and i wanted to purchase gems from a game ( the tribez) but it keeps showing me this message ........." this item is for an appliction that was purchased by a different apple id. to buy this item, with this apple id you must pu

    i have money in my account, and i wanted to purchase gems from a game ( the tribez) but it keeps showing me this message ........." this item is for an appliction that was purchased by a different apple id. to buy this item, with this apple id you must purchase the application. i dont understand the problem and how to pix it, please i need help.

    thanks kiltedTim its working your right it appears as they same game and now i can purchased and buy and item using my new apple id thanks a lot your a great help, Oppps i have one more questioned on it you have any idea how to changed a country regioned that still have a store credit balanced of point .23$ i want to changed it into the japanes store that which i have and itunes card, 

Maybe you are looking for