Urgently need code for tetris game

RULES OF GAME:
1. Spheres come down from the top of the game board in pairs. A player can rotate them on their way down.
2. Spheres come in 4 different colors: red, blue, green, and yellow
3. Linking four spheres of the same color (horizontally, vertically or both(as in tetris)) removes them from the game board, allowing any sphere remaining to drop and fill the vacated space.
This may lead to several possible "chain combos" if additional colors match.
4.      The game board can be any size you want (we recommend 6x12)
     Note that the pair of spheres are not linked to each other. If one sphere is blocked because there is something underneath, the other one will continue falling (with no player control over it) until it reaches something.
I am having the pictures of the spheres
- Please submit a java console application that will open a window and start the game.
- You may attach a separate text file that documents player controls and any other comments (as gameplay improvements, bugs not corrected, any comment that will help evaluate your submission...)
IMPORTANT:
- JAVA only - Java console application (not an applet)
Please Please Please Please send me the code to the following id
[email protected]

package com.chinmayananda
public class Tetris{
// complete here
code]
public abstract class AbstractTetris {
   public abstract void start();
   public abstract void stop();
}nearly done

Similar Messages

  • Urgently Need Code for Copy & Paste from Html Table in JSP to Excel file

    I am creating a html table in JSP file .
    I need code for 'Cut,Copy,Paste' functions ie. if someone wants to copy data from my table to excel file or from excel file to html table he shud be able to do that.
    Can someone give me code for 'Cut,Copy and Paste' i.e. some javascript functions which can do cut, copy and paste which i can put in my jsp file
    Thanks
    Message was edited by:
    javatechguru2007

    package com.chinmayananda
    public class Tetris{
    // complete here
    code]
    public abstract class AbstractTetris {
       public abstract void start();
       public abstract void stop();
    }nearly done

  • Need code for 3d game or anything

    I need the code for a 3d game or anything because i want to study the code so I understand how to make something 3d.

    Here ya go:
    class myClass {
      myClass(){
      public void main(String[] args){
    }You fill in the blanks.

  • Need code for sales order create report using bapi's

    need code for sales order create report using bapi's

    Hi,
    Go through below link
    http://www.saptechies.com/bapi_salesorder_createfromdat2/
    <b>Reward points if it helps,</b>
    Satish

  • Need code for restarting my system

    hello every body i need code for restarting system
    this code does not work
    try {
    Runtime.getRuntime().exec("shutdown -s -t01") // stop
    }catch(...
    or
    try {
    Runtime.getRuntime().exec("shutdown -r -t01") // reboot
    }catch(...
    or
    try {
    Runtime.getRuntime().exec("shutdown -l -t01") // logout
    }catch(...

    write a jni function that calls this method : ExitWindowsEx()
    check the documentation

  • Need code for Sales order creation in oops using xi as integration server

    Need code for Sales order creation in oops using xi as integration server.

    hi rocky,
              could you pls give a bit explanation on what you are expecting.
    regards,
    Pavan

  • Need code for ITC502

    I need code for gpib to ITC 502.
    Need to set temperature and threshold,
    thankx

    The instruction manual for this instrument is available from Oxford
    Instruments at no charge- they sent me a copy by email as a PDF file. I
    don't have it to hand at the moment so can't dig out the relevant info but
    it would be worth having the full manual, I think. There's a bit more to a
    decent driver than simply setting the temperature, and I'm not sure what you
    mean by "threshold".
    "mdeleon" wrote in message
    news:[email protected]..
    > I need code for gpib to ITC 502.
    > Need to set temperature and threshold,
    > thankx

  • Need code for padding (spacing) 5 navigation links in my #topnavbar internal style

    need code for padding (spacing) 5 navigation links in my #topnavbar internal style

    I'm new at this and the below code is regarding the navigation bar and links
    I started using a template to create the first html page and made copies of it to create the other four.
    All the links work but I wanted to space them apart further.
    They look basically like this horizontally: Home About Us Photo Gallery Services Contact Us
    #topnavbar {
    text-align:center;
    #topnavbar a:link a:visited{
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 100%;
    font-weight: bold;
    color: #039;
    text-decoration: none;
    margin: 0 25px:
    #topnavbar a:hover a:active {
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 100%;
    font-weight: bold;
    color: #039;
    text-decoration: none;
          <div id="topnavbar">
          <nav>
          <p><a href="index.html">Home</a>  
             <a href="aboutus.html">About Us</a>  
             <a href="photogallery.html">Photo Gallery</a>
             <a href="services.html">Services</a>
             <a href="contactus.html">Contact Us</a></p>  
          </nav>
           </div>

  • I'm new to jsf VWP..i need code for searching

    Hi,
    i need code for search...
    just populate records from database using jsf VWP5.5.1
    how to bind in table.
    we enter name r value in textbox click button related records display to table.how write code in button.
    pls help me....

    Don't crosspost. Please proceed here: http://forum.java.sun.com/thread.jspa?threadID=5211369

  • Urgently  need help for parsing IP header

    Hi, could anyone tell which class I should use to parsing the IP header of a packet?
    Thanks many many times!

    > Hi, could anyone tell which class I should use to
    parsing the IP header of a packet?
    DatagramPacket?
    > Urgently need help for parsing IP header
    Don't flag your question as urgent, even if it is for you.
    * We all answer questions here voluntarily, in our leisure time. We do that because doing so is fun for us, because we enjoy helping people and having interesting discussions. Guess what, it is much less fun if it gets stressful. So the last thing you want to do to get us to answer your question is to pass your stress over to us.
    * People who are stressed and want a fast answer often don't even find the time to do the necessary research or to formulate their question in an easy to comprehend way. That's even less fun to work with. So you really don't want us to feel your stress. Instead you want to take your time to write a well formulated post that is fun to answer. The less likely it is for us to know that your question is urgent, the more likely you are to get a fast answer!
    * The simple notion that you want your post to be answered faster than those of the other members might feel rather unfair to some of us. Doubly so because often "urgent" questions actually are homework questions. Yours might be different, but someone who had bad experiences with this type of question might not read far enough to notice.

  • KeyListener Help Needed for Tetris Game!

    * Tetris - Java Enhacned
    * By: Kunnel Zachariah, Johnathan Smith, Johnathan Adkins
    import javax.swing.JFrame;
    import java.awt.Color;
    import java.awt.Graphics;
    import javax.swing.Timer;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.event.KeyListener;
    import java.awt.event.KeyEvent;
    import static java.lang.Character.*;
    import java.awt.*;
    import java.awt.image.*;
    import java.applet.*;
    import java.lang.Math;
    import java.lang.System;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.Random;
    import java.awt.event.KeyAdapter;
    public class TetrisMain extends JFrame implements KeyListener
         int s;
         int p;
         int xPos;
         int yPos;
         int level = 1;
         int lines = 0;
         int score = 0;
         int switchPiece;
         private boolean[] keys;
         private int SLEEP = 50; //bigger # = slower animation
         private Timer timer;
         int bologna = 11;
        int posX[], posY[];
         Color color;
         boolean isSquare = false;
         public TetrisMain()
              setSize(550,710);
              setBackground(Color.black);
              setVisible(true);
              getContentPane();
         public static void main( String args[] )
              TetrisMain pongLab = new TetrisMain();
        public void paint (Graphics g)
              s=0;
              keys = new boolean[4];
              this.addKeyListener(this);
              g.setColor(Color.blue);
              g.fillRect(0,0,550,710);
              g.setColor(Color.black);
              g.fillRect(0,0,460,600);          
              g.setColor(Color.blue);
              g.setColor (Color.black);          
              g.setFont(new Font("Helvetica",Font.BOLD,14));
            g.drawString ("Level: " + level, 485, 40);
            g.drawString ("Lines: " + lines, 485, 80);
            g.drawString ("Score: " + score, 485, 120);
             ActionListener paintCaller = new ActionListener(){
                   public void actionPerformed(ActionEvent event)
                        repaint();  //recalls paint every SLEEP milliseconds
              timer = new Timer(SLEEP, paintCaller);
              timer.start();
              while (bologna <= 30)
             if ( keys[0] == true )
                   //move left paddle up and draw it on the window
                   s+=3;
              if ( keys[1] == true )
              //move left paddle down and draw it on the window
                   p+=3;
              if ( keys[2] == true )
                   s-=3;
              if ( keys[3] == true )
                   p-=3;
                        displayRandomPiece(g);
                        bologna++;
      public void drawGridVertical(Graphics g)
             for(xPos = 0; xPos <=460; xPos+=23)
             for(yPos=0; yPos <=600; yPos+=23)
                  g.drawLine(xPos,yPos,xPos,yPos);
        public void drawBlock(Graphics g)
         ImageIcon animatedIcon1 = new ImageIcon("untitled.gif");
         for(p =0; p <=530; p+=2)
          animatedIcon1.paintIcon(this,g,s,p);
          delay(100000);
        public void drawTpiece(Graphics g)
           ImageIcon animatedIcon = new ImageIcon("tpiece.gif");
          for(p =0; p <=530; p+=2)
          animatedIcon.paintIcon(this,g,s,p);
          delay(100000);
        public void drawZigZagpiece(Graphics g)
         ImageIcon animatedIcon2 = new ImageIcon("zigzagpiece.gif");
         for(p =0; p <=530; p+=2)
          animatedIcon2.paintIcon(this,g,s,p);
          delay(100000);
        public void Rectanglepiece(Graphics g)
             ImageIcon animatedIcon3 = new ImageIcon("rectangle.gif");
         for(p =0; p <=530; p+=2)
          animatedIcon3.paintIcon(this,g,s,p);
          delay(100000);
        public void Unknownpiece(Graphics g)
             ImageIcon animatedIcon4 = new ImageIcon("unknownpiece.gif");
         for(p =0; p <=530; p+=2)
          animatedIcon4.paintIcon(this,g,s,p);
          delay(100000);
        public void otherZigZagpiece(Graphics g)
             ImageIcon animatedIcon5 = new ImageIcon("otherzigzagpiece.gif");
          for(p =0; p <=530; p+=2)
          animatedIcon5.paintIcon(this,g,s,p);
          delay(100000);
         public void otherUnknownpiece(Graphics g)
             ImageIcon animatedIcon6 = new ImageIcon("otherunknownpiece.gif");
         for(p =0; p <=530; p+=2)
          animatedIcon6.paintIcon(this,g,s,p);
          delay(100000);
        public static void delay(double n)
              for (double x = 0; x <= n; x += .01);
          public boolean keyPressed(Event e, int key)
          if (key == Event.LEFT)
            s=-1;
          else if (key == Event.RIGHT)
            s+=1;
          else if (key == Event.UP)
            p-=1;
          else if (key == Event.DOWN)
          //  fast=true;
          else if (key == Event.ESCAPE)
           // ingame=false;
        return true;
         public void keyPressed(KeyEvent e)
              System.out.println("keypressed");
              switch(toUpperCase(e.getKeyChar()))
                   case 'W' : keys[0]=true;System.out.println("W keypressed"); break;
                   case 'Z' : keys[1]=true; System.out.println("z keypressed");break;
                   case 'I' : keys[2]=true; System.out.println("i keypressed");break;
                   case 'M' : keys[3]=true; System.out.println("m keypressed");break;
         public void keyReleased(KeyEvent e)
              System.out.println("released");
              switch(toUpperCase(e.getKeyChar()))
                   case 'W' : keys[0]=true; System.out.println("W realeased");break;
                   case 'Z' : keys[1]=true; System.out.println("Z realeased");break;
                   case 'I' : keys[2]=true; System.out.println("i realeased");break;
                   case 'M' : keys[3]=true; System.out.println("m realeased");break;
         public void keyTyped(KeyEvent e)
              //no code needed here
      public void displayRandomPiece(Graphics g)
           Random rand = new Random();
           int c = rand.nextInt((7)+1);
           switch(c)
                case 1:
                drawBlock(g);
                break;
                case 2:
                drawTpiece(g);
                break;
                case 3:
                drawZigZagpiece(g);
                break;
                case 4:
                Rectanglepiece(g);
                break;
                case 5:
                Unknownpiece(g);
                break;
                case 6:
                otherZigZagpiece(g);
                break;
                case 7:
                otherUnknownpiece(g);
                break;
    }This is my code so far for Tetris. I am having issues with my keylisteners! I keep pressing the specified keys and the println statements wont show up or the piece wont move! i really need major help. can anyone give me some advice
    Much Thanks,
    Chris!

    http://forum.java.sun.com/thread.jspa?threadID=5175447
    Don't double post! No help for you!

  • Need code for the following chess game..plz help me out

    Hi,
    Problem:Move the chess piece "KNIGHT" from any location on a "3 x 3" Chess Board and make it go to the far right hand bottom corner.Chess Board in the problem is not the usual Chess Board of 8 x 8.KNIGHT starting position may be any position on board.Program should exit when knight moves to 3 x 3 corner.Here is how my Chess board looks.
    |.... |.... |.... |
    |.... |.... |.... |
    |.... |.... |Queen |<<--The Queen should reach this position
    Remember: KNIGHT moves in specific way such as 2 steps in one direction and 1 step left/right.If the KNIGHT starts are position (2,2) then it cannot move further and you have to throw exception with some error message.
    Run command: "java <some class> x y", where x is x-coordinate and y is y-coordinate(starting position of Knight) on the chess board. For this problem x & y could be 1(min) and 3(max) values and any value(2) in between.
    Deliver : 1) Send me the java code for above problem.
    2) Java code should compile and run.
    3) I will be interested in "Object Oriented Design" thaught process.
    4) Your coding style
    5) Javadoc
    6) Makefile
    I would be more interested in your class design, interface design and error handling.
    please mail the solution to [email protected]
    thanks n regards
    Chinu

    Hi, Here Knight moves like horse. Queen doesn't
    exist. If knight moves to (3,3). Game will be over.
    I am facing problem to move knight from one point
    to another point. And also i have some confussion on
    selecting interfaces and classes.<font size="10000">do your own homework</font>

  • Need code for a function module- Urgent

    Hi friends,
    I have a requirement where I am giving material description as an import parameter in the function module. ( Material description could be a wild search -- say - Mat* ) I want a sub routine in the function module which should get all the materials from the database ( mara or makt..not sure ) for the user entered Material description.
    I want this particular code to be written using a sub-routine using formal parameters inside this fm . Could any one send me the code for this.
    Thanks in advance,
    Vishnu.

    Hi Vishvanath,,
    Please find the below code.
    DATA : BEGIN OF itab OCCURS 0,
           matnr LIKE makt-MATNR,
           MAKTX LIKE makt-MAKTX,
           END OF itab.
    DATA : BEGIN OF itab1 OCCURS 0,
           matnr LIKE makt-MATNR,
           MAKTX LIKE makt-MAKTX,
           END OF itab1.
    data : a(5) type c value 'TEST'.
    perform mat_no using a.
    form mat_no  using    p_a.
    data : lv_temp(4) type c.
    select matnr maktx from makt into table itab.
    loop at itab.
    lv_temp = itab-maktx+0(4).
    if lv_temp = p_a.
      move itab to itab1.
      APPEND ITAB1.
    endif.
    endloop.
    loop at itab1.
    write :/ itab1.
    endloop.
    endform.                    " mat_no
    Thanks.
    Amjad.

  • URGENT :T.code for allcoation invocies to down payment made

    < per the forum rules, don't use workds such as 'urgent' in the title.  thread locked >
    Hi Friends,
    could you please provide T.code for allocation invoices for down payment.
    Can you please give T.code it.s very URGEENT
    Thanks in addvance.
    Shekar
    Edited by: nama chandrashekar on Jun 12, 2008 2:21 PM

    hi,
    Your question is not clear.
    Down payment is down with following t.codes
    F-37 - Request
    F-29 - Down Payment
    F-39 - Clearing
    For SAP standard report on downpayments
    S_ALR_87012199 - List Of Down Payments Open On Key Date - Customers
    Please let me know if you need more  information.
    Assign points if useful.
    Regards
    Sridhar M

  • Need Code for book publishing in BPC

    Does anyone have any VBA code for generating multiple report tabs?  This would take the place of book publishing since I do not want to create PDFs or HTML reports, but rather spreadsheets.

    I am just noticing this -   did you resolve your issue?   You basically need to write the code.
    Edited by: Deborah Silverman on Mar 16, 2009 7:30 PM

Maybe you are looking for

  • How can I transfer my star ratings to my new computer?

    Just bought a new Dell. I have ITunes on my old computer, and have spent lots of time creating playlists and star ratings. How can I import that into my new computer? I have a video Ipod with my complete music library on it, and when I connect it to

  • Upgrade from 10.0.4 to 10.2.8

    I have an early version of OS X because I was too disorganised to upgrade before. But now I find if I want to print with an HP Officejet G55 I need at least 10.2.8 for the printer driver to work. Can anyone advise how I can upgrade to 10.2.8.? I can'

  • Infopackage data selection & deltas

    Hi BW Experts, I have a few questions about infopackage and delta loads: 1) How to perform mulitiple data selection.  e.g. company codes 1000, 1001 and 5000?  I can't filter by From To data selection since I do not want to include companies 2000, 300

  • How to Create an activity based on business partner

    hi guys, Can any body help regarding the below scenario. 1) Creation an business partner. 2) create an acitvity based on business partner. 3) Create an lead and opputunity based on business parter. What are the function modules should we used to crea

  • How do I Open Appleworks files with Microsoft Works

    I have MS Works 6.0, and WORD for Windows XP. My files from school are all in Appleworks 5.0. Can I open them? HP Pavillion   Windows XP