Can someone tell me what's wrong with this method

public boolean drop(int col, int piece) {
          if (isLegalMove(col)) {
               for (int r = 0; r < getNumRows(); r++) {
                    if (mySpaces[r][col] == EMPTY) {
                         mySpaces[r][col] = piece;
                         return true;
          } else
               return false;
     }it always asks that I need to return something, what should I do??

public boolean drop(int col, int piece) {
    if (isLegalMove(col)) {
        for (int r = 0; r < getNumRows(); r++) {
          if (mySpaces[r][col] == EMPTY) {
            mySpaces[r][col] = piece;
            return true;
    } //else <--- remove the else
    return false;
}

Similar Messages

  • Can someone tell me what's wrong with this LOV query please?

    This query works fine..
    select FILTER_NAME display_value, FILTER_ID return_value
    from OTMGUI_FILTER where username = 'ADAM'
    But this one..
    select FILTER_NAME display_value, FILTER_ID return_value
    from OTMGUI_FILTER where username = apex_application.g_user
    Gives the following error.
    1 error has occurred
    * LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Thanks very much,
    -Adam vonNieda

    Ya know, I still don't know what's wrong with this.
    declare
    l_val varchar2(100) := nvl(apex_application.g_user,'ADAM');
    begin
    return 'select filter_name display_value, filter_id return_value
    from otmgui_filter where username = '''|| l_val || '''';
    end;
    Gets the same error as above. All I'm trying to do is create a dropdown LOV which selects based on the apex_application.g_user.
    What am I missing here?
    Thanks,
    -Adam

  • Can someone tell me what's wrong with this code....

    I apologize in advance for anyone who isn't a Steelers fan...
    import java.awt.*;
    import javax.swing.*;
    public class myJPanel extends JPanel
         public myJPanel()
              setBackground(Color.white);
         JLabel label1 = new JLabel();
         label1.setText("Ben Roethlisberger #7 Age 23");
         add(label1);
         JButton jb1;
         ImageIcon imageBen = new ImageIcon("Ben.JPG");
         jb1 = new JButton(imageBen);
         add(jb1);
         JLabel label3 = new JLabel();
         label3.setText(whatIsUp());
         add(label3);
         for(i=0;i<20;i++)
         String whatIsUp()
              int n = 0;
              double nn = 0;
              String b = "......";
              nn = (Math.random() * 6);
              n = (int)nn;
              if (n == 0)
                   b = "Ben Roethlisberger throws a touchdown pass to Hines Ward.";
                   JButton jb2;
              ImageIcon imageHines = new ImageIcon("Hines.jpg");
              jb2 = new JButton(imageHines);
              add(jb2);
              if (n == 1) b = "Ben Roethlisberger throws a touchdown pass to Antwaan Randle El.";
              if (n == 2) b = "Ben Roethlisberger throws a touchdown pass to Heath Miller.";
              if (n == 3) b = "Ben Roethlisberger throws a touchdown pass to Cedrick Wilson.";
              if (n == 4) b = "Ben Roethlisberger throws a touchdown pass to Jerame Tuman.";
              if (n == 5) b = "Ben Roethlisberger hands off to Jerome Bettis for a touchdown.";
              return b;
    Everything is ok if i take the for loop out, but for some reason everything just gets screwed up if I have that for loop in there. And these are the error messages I'm getting.
    'illegal start of type (line 21)' and '<identifier> expected (line 48)'
    Thanks in advance for your help...

    Hey I'm sorry but this is only my second week doing
    Java. Do you think you could explain that more or
    give me an example??
    Bad Version (like yours but simplified)
    public class Sample{
      public static void main(String args[]){
        for(int i=0;i<20;i++){
          String whatIsUp(){
             return "Doc";
          System.out.println(?);// I am not even sure how to write this voodoo part
    }Good Version
    public class Sample{
      public static void main(String args[]){
        for(int i=0;i<20;i++){
          String aString = whatIsUp();
          System.out.println(aString);
      String whatIsUp(){
        return "Doc";
    }

  • Can someone tell me what's wrong with my router?

    i was just using my router half-hour ago and it was working fine......i come back on a little bit and it is not working anymore........my wlan and dmz light in front of my WRT54G router won't light up and it keeps telling me that my connection is limited...i already reset both router and cable modems like 100 times already..is there any way i could fix this?

    okay...  if you are using cable internet connection, try restting the router back to factory default settings by pressing reset butoon on the back panel of router, power cycle the n/w by unplugging power cable of router and modem, wait for couple of minutes and power up the modem first once modem is rebooted power up the router, check internet works or not, if still doesn't work let me know which internet service are you using also tell me version no of WRT54G router so that i can tell you step by step configuration of router...

  • Can someone tell me what's wrong with my threading code

    I got some code from a Java book on how to create a simple threading application. This is the exact code from the book but for some reason it gives me an error that non-static variables can not be referenced from static content. How can I reword this to work?
    <CODE>
    package multithread;
    import java.io.*;
    import java.util.*;
    public class MultiThread {
    class CountDownEven extends Thread {
    public void run() {
    for (int i = 6; i > 0; i -= 2) {
    System.out.println(this.getName() + " Count" + i);
    Thread.yield();
    class CountDownOdd extends Thread {
    public void run() {
    for (int i = 5; i > 0; i -= 2) {
    Thread.yield();
    public static void main(String[] args) {
    try {
    CountDownEven count1 = new CountDownEven();
    CountDownOdd count2 = new CountDownOdd();
    count1.start();
    count2.start();
    catch (Exception e)
    </CODE>

    One possible solution:public static void main(String[] args) {
         try {
              MultiThread m = new MultiThread();
              CountDownEven count1 = m.new CountDownEven();
              CountDownOdd count2 = m.new CountDownOdd();
              count1.start();
              count2.start();
         } catch (Exception e) {
    }

  • Please can someone tell me what's wrong in this code

    1var a=0;
    2function main(){
    3var inFolder = Folder.selectDialog("Please select folder to process");
    4//Save the Current Preferences
    5var startRulerUnits = preferences.rulerUnits;
    6preferences.rulerUnits = Units.PIXELS;
    7//Get all the files in the folder
    8var filelist=inFolder.getFiles()
    9n=filelist.length;
    10//Open each file
    11for(a=0; a<n; a++){
    12// The fileList is folders and files so open only files
    13if (fileList[a] instanceof File) {
    14open(fileList[i])
    15var docName = app.activeDocument.name;
    16app.activeDocument.flatten();
    17activedocument.save();
    18}
    19}
    20}
    21main();
    Says the error is "filelist is not recognized".    on line 14.   I thought I had fully defined 'filelist' on line8
    I thought filelist was a one-D array variable.
    Peterkal

    Also, in lines 8 and 9 you use a variable called "filelist" but in lines 13 and 14 you call it "fileList" (notice the capital-L).
    JavaScript is case-sensitive, so you must be consistent with your variable names throughout.

  • Can someone tell me i did wrong with this part of my code?

    choice = Integer.parseInt (usersChoice);//Math Conversion
         Input = JOptionPane.showInputDialog(null, "How many would you like?[" + Quantity +"]: ");
         price[Quantity] = Float.parseFloat(Input);//conversion from string to int
    JOptionPane.showMessageDialog(null, "You want: " + price[Quantity]);
    for (Quantity=0; Quantity<100;Quantity++)
    When i try to compile i am getting an error "incompatible types" and operator > and ++ cannot be applied to int[],int and int[]

    When i ask a question of my instructor i am lucky if i get a response 48 hrs later, and as for asking my peers, most of them are just as confused as i am. All i am doing is trying to learn i am sorry if you feel that asking on this forum is wrong, but like i said i am attemtping to learn and i figured that who better than to ask then a bunch of people who know Java like the back of their hands.

  • I have i pad 2 ios 4.3.1 i want to update it to 4.3.3 but i get error msg 3194 can you tell me what's wrong with apple some people talking about apple don't veryfiy 4.3.3 anymore thanks alot

    i have i pad 2 ios 4.3.1 i want to update it to 4.3.3 but i get error msg 3194 can you tell me what's wrong with apple some people talking about apple don't veryfiy 4.3.3 anymore thanks alot

    4.3.5 is the current version, so that is the version that iTunes will download, not 4.3.3
    In terms of error 3194, have you got the latest version of iTunes on your computer ? - http://support.apple.com/kb/TS3694#error3194

  • I can't figure out what's wrong with this code

    First i want this program to allow me to enter a number with the EasyReader class and depending on the number entered it will show that specific line of this peom:
    One two buckle your shoe
    Three four shut the door
    Five six pick up sticks
    Seven eight lay them straight
    Nine ten this is the end.
    The error message i got was an illegal start of expression. I can't figure out why it is giving me this error because i have if (n = 1) || (n = 2) statements. My code is:
    public class PoemSeventeen
    public static void main(String[] args)
    EasyReader console = new EasyReader();
    System.out.println("Enter a number for the poem (0 to quit): ");
    int n = console.readInt();
    if (n = 1) || (n = 2)
    System.out.println("One, two, buckle your shoe");
    else if (n = 3) || (n = 4)
    System.out.println("Three, four, shut the door");
    else if (n = 5) || (n = 6)
    System.out.println("Five, six, pick up sticks");
    else if (n = 7) || (n = 8)
    System.out.println("Seven, eight, lay them straight");
    else if (n = 9) || (n = 10)
    System.out.println("Nine, ten, this is the end");
    else if (n = 0)
    System.out.println("You may exit now");
    else
    System.out.println("Put in a number between 0 and 10");
    I messed around with a few other thing because i had some weird errors before but now i have narrowed it down to just this 1 error.
    The EasyReader class code:
    // package com.skylit.io;
    import java.io.*;
    * @author Gary Litvin
    * @version 1.2, 5/30/02
    * Written as part of
    * <i>Java Methods: An Introduction to Object-Oriented Programming</i>
    * (Skylight Publishing 2001, ISBN 0-9654853-7-4)
    * and
    * <i>Java Methods AB: Data Structures</i>
    * (Skylight Publishing 2003, ISBN 0-9654853-1-5)
    * EasyReader provides simple methods for reading the console and
    * for opening and reading text files. All exceptions are handled
    * inside the class and are hidden from the user.
    * <xmp>
    * Example:
    * =======
    * EasyReader console = new EasyReader();
    * System.out.print("Enter input file name: ");
    * String fileName = console.readLine();
    * EasyReader inFile = new EasyReader(fileName);
    * if (inFile.bad())
    * System.err.println("Can't open " + fileName);
    * System.exit(1);
    * String firstLine = inFile.readLine();
    * if (!inFile.eof()) // or: if (firstLine != null)
    * System.out.println("The first line is : " + firstLine);
    * System.out.print("Enter the maximum number of integers to read: ");
    * int maxCount = console.readInt();
    * int k, count = 0;
    * while (count < maxCount && !inFile.eof())
    * k = inFile.readInt();
    * if (!inFile.eof())
    * // process or store this number
    * count++;
    * inFile.close(); // optional
    * System.out.println(count + " numbers read");
    * </xmp>
    public class EasyReader
    protected String myFileName;
    protected BufferedReader myInFile;
    protected int myErrorFlags = 0;
    protected static final int OPENERROR = 0x0001;
    protected static final int CLOSEERROR = 0x0002;
    protected static final int READERROR = 0x0004;
    protected static final int EOF = 0x0100;
    * Constructor. Prepares console (System.in) for reading
    public EasyReader()
    myFileName = null;
    myErrorFlags = 0;
    myInFile = new BufferedReader(
    new InputStreamReader(System.in), 128);
    * Constructor. opens a file for reading
    * @param fileName the name or pathname of the file
    public EasyReader(String fileName)
    myFileName = fileName;
    myErrorFlags = 0;
    try
    myInFile = new BufferedReader(new FileReader(fileName), 1024);
    catch (FileNotFoundException e)
    myErrorFlags |= OPENERROR;
    myFileName = null;
    * Closes the file
    public void close()
    if (myFileName == null)
    return;
    try
    myInFile.close();
    catch (IOException e)
    System.err.println("Error closing " + myFileName + "\n");
    myErrorFlags |= CLOSEERROR;
    * Checks the status of the file
    * @return true if en error occurred opening or reading the file,
    * false otherwise
    public boolean bad()
    return myErrorFlags != 0;
    * Checks the EOF status of the file
    * @return true if EOF was encountered in the previous read
    * operation, false otherwise
    public boolean eof()
    return (myErrorFlags & EOF) != 0;
    private boolean ready() throws IOException
    return myFileName == null || myInFile.ready();
    * Reads the next character from a file (any character including
    * a space or a newline character).
    * @return character read or <code>null</code> character
    * (Unicode 0) if trying to read beyond the EOF
    public char readChar()
    char ch = '\u0000';
    try
    if (ready())
    ch = (char)myInFile.read();
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    if (ch == '\u0000')
    myErrorFlags |= EOF;
    return ch;
    * Reads from the current position in the file up to and including
    * the next newline character. The newline character is thrown away
    * @return the read string (excluding the newline character) or
    * null if trying to read beyond the EOF
    public String readLine()
    String s = null;
    try
    s = myInFile.readLine();
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    if (s == null)
    myErrorFlags |= EOF;
    return s;
    * Skips whitespace and reads the next word (a string of consecutive
    * non-whitespace characters (up to but excluding the next space,
    * newline, etc.)
    * @return the read string or null if trying to read beyond the EOF
    public String readWord()
    StringBuffer buffer = new StringBuffer(128);
    char ch = ' ';
    int count = 0;
    String s = null;
    try
    while (ready() && Character.isWhitespace(ch))
    ch = (char)myInFile.read();
    while (ready() && !Character.isWhitespace(ch))
    count++;
    buffer.append(ch);
    myInFile.mark(1);
    ch = (char)myInFile.read();
    if (count > 0)
    myInFile.reset();
    s = buffer.toString();
    else
    myErrorFlags |= EOF;
    catch (IOException e)
    if (myFileName != null)
    System.err.println("Error reading " + myFileName + "\n");
    myErrorFlags |= READERROR;
    return s;
    * Reads the next integer (without validating its format)
    * @return the integer read or 0 if trying to read beyond the EOF
    public int readInt()
    String s = readWord();
    if (s != null)
    return Integer.parseInt(s);
    else
    return 0;
    * Reads the next double (without validating its format)
    * @return the number read or 0 if trying to read beyond the EOF
    public double readDouble()
    String s = readWord();
    if (s != null)
    return Double.parseDouble(s);
    // in Java 1, use: return Double.valueOf(s).doubleValue();
    else
    return 0.0;
    Can anybody please tell me what's wrong with this code? Thanks

    String[] message = {
        "One, two, buckle your shoe",
        "One, two, buckle your shoe",
        "Three, four, shut the door",
        "Three, four, shut the door",
        "Five, six, pick up sticks",
        "Five, six, pick up sticks",
        "Seven, eight, lay them straight",
        "Seven, eight, lay them straight",
        "Nine, ten, this is the end",
        "Nine, ten, this is the end"
    if(n>0)
        System.out.println(message[n]);
    else
        System.exit(0);

  • Someone who is good with CSS-P tell me what is wrong with this?

    I'm doing a remake of my current site but this time I'm going
    to do it
    COMPLETLEY tabless and use CSS-P. So far I'm doing great but
    there is one
    thing I can't figure out for the life of me...
    http://verticalterrain.com/Templates/main.dwt
    Check out my template I'm building there and someone tell me
    why in god's
    name is the "About Us" button on a totally seperate line. If
    you view my
    source code there is no <br /> or anything like that.
    Anyone have any
    ideas?
    Best Regards,
    Chris Jumonville
    iMedia Web Design
    503.277.3553

    On Fri, 10 Nov 2006 11:48:55 +0100, A.Translator
    <[email protected]> wrote:
    >You are asking about CSS-P but only show your html.
    >Makes it hard to tell what is going on.
    The link is in the template!
    http://verticalterrain.com/style.css
    Steve
    steve at flyingtigerwebdesign dot com

  • What is wrong with this method?

    When i try to compile
         public double generateXPos()
              double d = Math.random()*100;
              if (d > 37.0)
                   generateXPos();
              else
                   return d;
    it says: "this method must return a result of type double", bit doesn't it do so?!?
    By the way I am using eclipse v. 3.0.1
    Thanks in advance,
    Floesch

    Because i could not think of this way of doing that,
    for i am a bloody beginner.A "bloody" beginner? You should wipe yourself off with a damp cloth.
    Could you tell me how to do it then?I can point you in the right direction. The first line of your method generates a number between 1 and 100. Either you intentionally wrote it to work that way, in which case you should very easily be able to re-write it to generate a number between 1 and 37 instead; Or, perhaps you copied it from somewhere else not understanding what it does, in which case you should take the time to understand it before continuing.
    Either way, as you now know that the first line generates a number between 1 and 100, you should be able to make a good guess at how to change it so that the generated number is between 1 and 37. If nothing at all springs to mind here, then I really genuinely do believe you aren't the kind of person that's gonna do well as a programmer.

  • Can anyone tell me what's wrong with my queue or producer consumer loop?

    A Labview engineer helped me with the overall structure of my program, necessitated by the fast data sample rate and post processing requirements. He recommended the producer/consumer loop and using one of the example files (Cont Acq graph voltage - int clk) to do the actual data acquistion. So I put together the loop and go my two channels of data acq going in the producer loop. However, nothing's getting picked up in the consumer loop and none of my data gets displayed over there.
    Anyone care to take a look at it and let me know what I'm doing wrong?
    Solved!
    Go to Solution.
    Attachments:
    P-C Yanmar Program.vi ‏296 KB

    Your Enque Element should be inside the while loop where you aquire the data.  As it is now, the data has to stop being aquired before you send the last set of aquired data.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Could someone tell me what is wrong with AS 3.0

    I'm moving a movie clip that is off the stage and acts as a
    popup window to the visible area. then i'm animating it to cover
    the entire stage size. then moving a box in.
    This thing is very very buggy. It works about 70% of the time
    correct. I have the variables of the size traced and they are
    ALWAYS correct. However the animation doesn't reflect this.
    Sometime the box won't animate the width, sometimes the height, and
    sometimes it doesn't show up at all. What is going on?
    Thanks!

    your code is correct (with the assumptions given above). you
    can test it outside your current project and verify that it works.
    i just finished a project where i ported an as2 application
    to as3. that application used many tweens and i kept them in the
    as3 version. i did run into some problems with the tweens that i
    solved by giving the tweens different names.
    for example, if you call layersWindowIn() twice, with the
    second call occurring before the first has completed, you'll
    probably run into problems. is that when the problems occur?

  • Can anyone tell me what is wrong with the simple sql?

    Hi,
    I have a simple SQL (see attached). It returns records when it does not include the Order By sorting clause. However, if it includes the Order By clause, Oracle says no data found. Anyone can give me some ideas what could cause the problem?
    Thanks in advance.
    SELECT ih.item_key, e.episode_key, e.episode_date, wp.work_package_key, p.patient_name, c.codes_key
    FROM work_package wp, episodes e, item_header ih, patients p, codes c, station_element se, station_data sd
    WHERE wp.work_item_key = e.episode_key
    and e.episode_key = ih.item_key
    and ih.logical_parent_key = p.patient_key
    and e.episode_type = c.code_value
    and wp.asgn_station_key = se.item_key
    and se.station_name like 'DICT FIX%'
    and sd.station_key = wp.asgn_station_key
    and (sd.facility = '0' or sd.facility = 1)
    and wp.on_hold <> 'Y' and c.code_type = 'CEPT'
    and c.setup_group = 1
    ORDER BY e.episode_date, e.medrec_no;

    Hmmm...can you post a SQL Plus session that demonstrates this?

  • While working in multi camera editing in FCP X, having only 2 angles, after cutting for 30 minutes, the editing starts slowing down gradually until it becomes unbearably slow. Can someone tell me what is wrong?

    This is the second time I am using the multicamera editing mode. The first time I used it with 2 angles of HD 720p and it worked perfectly. This time I am working with standard definition vodeo and is giving me this problem.

    This is my pet checklist for questions regarding FCP X performance.
    Make sure you're using the latest version - FCP X 10.0.3 runs very well on my 2009 MacPro 2 x 2.26 GHz Quad-Core Intel Xeon with 16 GB RAM and ATI Radeon HD 5870 1024 MB. I run it with Lion 10.7.3.
    First, check that you have at least 20% free space on the Hard Drive that your System and your Media, Projects and Events are on.
    Check the spec of your Mac against the system requirements:
    http://www.apple.com/finalcutpro/specs/
    Check the spec of your graphics card. If it's listed here, it's not suitable:
    http://support.apple.com/kb/HT4664
    If you are getting crashes, there is some conflict on the OS. Create a new (admin) user account on your system and use FCP X from there - if it runs a lot better, there's a conflict and a clean install would be recommended.
    Keep projects to 20 mins or less. If you have a long project, work on 20 min sections then paste these into a final project for export.
    Create Optimised media - most camera native files are highly compressed and need a great deal of processor power to play back - particularly if you add titles, filters or effects. ProRes 422 takes up much more hard drive space but is very lightly compressed. It edits and plays back superbly.
    If you are short of drive space, use ProRes 422 Proxy (FCP X Preferences > Playback) - but remember to select 'Original or Optimised Media' just before you export your movie, otherwise it will be exported at low resolution.
    Hide Audio Waveforms at all times when you don't need them (both in Browser and Storyline / Timeline). They take up a lot of processor power. (Use the switch icon at the bottom-right of your timeline to select a format without waveforms if you don't need them at the moment, then switch back when you do).
    Create folders in the Project and Events libraries and put any projects you are not working on currently, in those folders. This will help a lot.
    Move your Projects and Events to a fast (Firewire 800 or faster) external HD (make sure it's formatted OS Extended - with journaled on or off) and run from there.
    Unless you cannot edit and playback without it, turn off Background Rendering in Preferences (under Playback) - this will help general performance and you can always render when you need to by selecting the clip (or clips) and pressing Ctrl+R.
    The biggest single improvement I saw in performance was when I upgraded the RAM from 8 GB to 16.
    Andy

Maybe you are looking for