Need help with connecting internal cables

I opened up my iMac to install a new superdrive and I am having trouble finding where 3 cables go. One cable comes from the internal camera One comes from the monitor and the third one is from a card . The first 2 are pins and the third one is a rounded plastic connector. Any ideas.

If this iMac is from 2001, it is probably not an iMac G5. This forum category is for the iMac G5. So can you confirm the type of iMac. 2001 would probably make it a slot-loader iMac G3.
Your options will depend on the type of iMac you have.

Similar Messages

  • Need help with connecting file inputs to arrays

    In this assignment I have a program that will do the following: display a list of names inputed by the user in reverse order, display any names that begin with M or m, and display any names with 5 or more letters. This is all done with arrays.
    That was the fun part. The next part requires me to take the names from a Notepad file, them through the arrays and then output them to a second Notepad file.
    Here is the original program: (view in full screen so that the code doesn't get jumbled)
    import java.io.*;       //Imports the Java library
    class progB                    //Defines class
        public static void main (String[] arguments) throws IOException
            BufferedReader keyboard;                                  //<-
            InputStreamReader reader;                                 //  Allows the program to
            reader = new InputStreamReader (System.in);               //  read the the keyboard
            keyboard = new BufferedReader (reader);                  //<-
            String name;                 //Assigns the name variable which will be parsed into...
            int newnames;               //...the integer variable for the amount of names.
            int order = 0;              //The integer variable that will be used to set the array size
            String[] array;             //Dynamic array (empty)
            System.out.println (" How many names do you want to input?");   //This will get the number that will later define the array
            name = keyboard.readLine ();
            newnames = Integer.parseInt (name);                                         // Converts the String into the Integer variable
            array = new String [newnames];                                               //This defines the size of the array
            DataInput Imp = new DataInputStream (System.in);       //Allows data to be input into the array
            String temp;                                       
            int length;                                                                  //Defines the length of the array for a loop later on
                for (order = 0 ; order < newnames ; order++)                                //<-
                {                                                                           //  Takes the inputed names and
                    System.out.println (" Please input name ");                            //  gives them a number according to
                    temp = keyboard.readLine ();                                           //  the order they were inputed in
                    array [order] = temp;                                                  //<-
                for (order = newnames - 1 ; order >= 0 ; order--)                                //<-
                {                                                                                //  Outputs the names in the reverse 
                    System.out.print (" \n ");                                                   //  order that they were inputed
                    System.out.println (" Name " + order + " is " + array [order]);             //<-
                for (order = 0 ; order < newnames ; order++)                                  //<-
                    if (array [order].startsWith ("M") || array [order].startsWith ("m"))     //  Finds and outputs any and all
                    {                                                                         //  names that begin with M or m
                        System.out.print (" \n ");                                            //
                        System.out.println (array [order] + (" starts with M or m"));         //
                    }                                                                         //<-
                for (order = 0 ; order < newnames ; order++)                                            //<-
                    length = array [order].length ();                                                   //
                    if (length >= 5)                                                                    //  Finds and outputs names
                    {                                                                                  //  with 5 or more letters
                        System.out.print (" \n ");                                                      //
                        System.out.println ("Name " + array [order] + " have 5 or more letters ");      //<-
    }The notepad file contains the following names:
    jim
    laruie
    tim
    timothy
    manny
    joseph
    matty
    amanda
    I have tried various methods but the one thing that really gets me is the fact that i can't find a way to connect the names to the arrays. Opening the file with FileInputStream is easy enough but using the names and then outputing them is quite hard. (unless i'm thinking too hard and there really is a simple method)

    By "connect", do you just mean you want to put the names into an array?
    array[0] = "jim"
    array[1] = "laruie"
    and so on?
    That shouldn't be difficult at all, provided you know how to open a file for reading, and how to read a line of text from it. You can just read the line of text, put it in the array position you want, until the file is exhausted. Then open a file for writing, loop through the array, and write a line.
    What part of all that do you need help with?

  • Need Help for connectivity USB Cable Nokia 5800 ca...

    Hi All,
    I really need help to solve my problems. I just bought nokia 5800 XM last week. I already installed the CD software in my windows XP, but it seems that PC cannot recognize the USB cables. I have plug in an unplugged... At firstime it detects my nokia 5800 XM, but when I open PC suite or OVI, it doesn't connect the USB cables into PC. I already install and uninstall The OVI suite but it is still the same, when I try it in OVI suite to detect my phones, it doesn't react.... I also have download from Nokia website to install manually Nokia USB cable driver for my  cable type CA-101... it seems nothing works here... tell me what should I do? I don't think that the USB cable I bought is fake, it has original guarantee..... please desperately need help! Anybody? 

    When you plug the phone into the computer, ON THE PHONE it should ask you which mode to connect in, and you should select "PC Suite" mode.  Does this happen?
    Ravi

  • MSI P67A-C45 (B3) Newb needs Help with connections..

    Hi all..
    First time posting here, but have been in the shadows for quite a while..   
    Anyway, i decided to finally take the plunge, and build my own PC, and now i'm beginning to hit a few bumps.
    I have a couple of questions that i would like some help with, if possible to reassure myself i may be in the right direction..
    I bought THIS PSU and was hoping someone could tell me where the Blue connectors (one labelled CP and one labelled U1) Connect to?
    Is it into JPWR2? And does it/do they only connect in the correct way? (Do i remove the plastic cap and attach both?
    and i bought THIS VIDEO/GRAPHICS CARD and i'm guessing the RED "PCI express" and "SLI ready" connect to that somehow (Haven't opened box yet for card)
    Again, wondering is there a certain way for them to connect.
    Also, from my chassis, the "AC '97" and "HDA" connectors go to JAUD (I guess), does it matter which one? (I currently have "HDA" connected)
    I have i5 2500k already on board. (If that makes a difference).

    Quote from: Ben_Cartwright on 26-May-11, 22:05:35
    Do the Audio plugs go into JAUD? and does it matter which one?
    Yep, connect the front panel audio to the JAUD. If you need the pin layout, it says in the manual. I would say the HDA connector is the one to connect.
    Quote from: Ben_Cartwright on 26-May-11, 22:05:35
    Any recommendations for testing it all, before i plug it in, and press the power?
    Should i (Can i) test individual parts first?
    Thanks again.
    Check all power connections, seating of the RAM and add-on cards, check the HSF is plugged into the fan header, and obvious things like that.
    As for testing, enter the BIOS and make sure the CPU isn't running too hot. Set up the RAM with the required timings and voltage, and test with >>Memtest86<< for several hours. No point starting the Windows installation if say your RAM has errors, since it will corrupt files during the install, if it installs at all.

  • Need help with connecting laptop

    Hi there,
      I looked through the boards and found some messages that kind of fit to my problem, but not completely so here goes. 
    I have a gateway desktop(windows xp) connected to dsl (charter) and a laptop(gateway solo with windows xp) that I am trying to connect through a wireless router (Linksys wrt54g). 
    When I connect the wireless router to my laptop it says it is connected, but I cannot get a webpage to appear and once my router is connected I cannot use my desktop online. 
    I am sure there is just some configurations that need done, but I'm not that familiar with alot of the comuter lingo in order to figure this one out on my own.  I mainly use the desktop, but I would like to configure the laptop so I can use it online when needed.  Help and keep it simple please...
    Another question...do I need to use the wireless router or can I somehow connect my laptop through my desktop or just through my dsl connection?
    Thanks, Deanna

    Connect the Modem to the Internet Port on the Router.
    Then , Connect the Computer using a different
    Ethernet Cable to Port 1 or Port 2 on the Router.
    Now, Press the Reset Button on the rear panel of the Router
    for 12 Seconds. Then, Release the Reset Button,
    Unplug the Power Adapter to the Router. After 10 Seconds,
    Unplug the Power Adapter to the Modem. Then Wait for
    30 Seconds, Re-connect the Modem, and once the Lights are
    up on the Modem, Re-connect the Linksys Router.
    If yes, Open a new Internet Explorer
    Page, and in the address bar, type http://192.168.1.1, press
    return, And when asked for Username and Password,
    Leave the Username blank and in the Password field,
    type admin . This will help you access the Router's
    Console.
    In the Router's Setup Page, just below Setup Tab,
    in the blue line, you could an option " MAC Address Clone "
    Click on that, Enable it, Save the Settings
    Below the Setup Tab of the Router's Console,
    Change the MTU from "AUTO" to "MANUAL" , and
    Set the Size to 1400, Save the Settings,
    Powercycle the Modem and the Router.
    Check the Connections.
    If you are able to go Online when hard wired to the Router.
    Then make your computer wireless and verify . . .

  • CS5.5 need help with connecting to wsdl

    Hello,
    I'm new to Dreamweaver CS5.5 and i'm looking for a simple way to connect to a CFC wsdl web service.
    Basically need to pass 1 parameter to the webservice and have it return a string result from our database.
    Is this possible to do from dreamweaver, using javascript ?
    thanks.

    Those crosshairs are controllers for an effect. The first thing to do is to start turning off layers (eyeball) until you find the layer with the crosshairs. Once you've isolated the layer make sure that it's not a pre-comp, press F3 to reveal the ECW, and check the effects. If you can't turn the effects on and off then or access any of the settings the layer is locked. What would really help here is a screenshot. I can't tell much from the photo because I can't see what's under the hood.

  • Need help with Connect to iTunes error.

    My iPhone 3GS is stuck with the "Connect to iTunes" image. It will not go away.
    It happened when I tried to get the IOS 6.0 update. I had the same issue with my iPad when I tried getting the update but at least my iTunes recognized my iPad after 2 or 3 days. I cannot wait that long to get my phone working again.
    Right now, iTunes will not recognize my phone at all.
    I have tried most of the troubleshooting tips i.e. I'm running the latest version of iTunes, I have restarted my laptop, I have done a few gard resets on my iPhone, power down, power up..etc..etc.
    I'm using a PC with windows 7.
    Any help/suggestions will be much appreciated.
    Thanks is advance.

    See:
    iOS: Unable to Update or Restore
    http://support.apple.com/kb/ht1808

  • Need help with initializing isp cable broadband and its relation to ADSL

    hi ,
    i have a question ,
    ive desigmnet and implemented isp of ADSL from scratch ,
    ive implemented LAC & LNS Router with L2TP and integrated it with AAA.
    now
    im asking about ,
    the ADSL system i desribed above
    and
    defirrence between it and cable broadband ??
    is there alot of differences between them ?
    can somebody give me standard isp topolofy for cable mode system ?
    regards

    My way of looking at it is that i neeed nothing else
    and it should just see a wirelless network from the
    router and connect to that, is that right?
    Yes.

  • Need help with connected / linked pop-up menus

    I want to select a preset.
    What I did is create 2 pop-up menus. The first with the preset folders and the second with the presets from that folder.
    Each pop-up group has a pop-up and a static field with the current choise.
    After selecting a different value from the first pop-up menu I want to have the second popup menu filled with the new, right presets of that folder.
    The first time everything works correct.
    However when selecting a different folder I see that the "preset table"  is filled with the correct new preset of that folder. Also the static field below the second pop-up menu shows the first value of the correct new presets. But the second pop-up menu itself still contains the presets of the first folder and not the new folder.
    Yet in the Observer I see that the preset table contains the right and new presets.
    My code is below.
    I based it on the sample in the SDK manual.
    Question: How can I update the second pop-up menu so that the pop-up menu shows the right presets.
    Code below
    local LrApplication = import 'LrApplication'
    local LrPathUtils = import 'LrPathUtils'
    local LrFileUtils = import 'LrFileUtils'
    local LrBinding = import "LrBinding"
    local LrDialogs = import "LrDialogs"local LrFunctionContext = import "LrFunctionContext"
    local LrView = import "LrView"
    local bind = LrView.bind -- shortcut for bind() method
    --     https://github.com/kikito/inspect.lua
    local inspect = require 'inspect'
    local logFilename = 'PresetList'
    local myLogger = import 'LrLogger'( logFilename )
    myLogger:enable( "logfile" )
    local logPath
    Name          emptyLogFile
    Purpose          Clears the existing log file.
    From cookbook: http://cookbooks.adobe.com/post_Clearing_your_logfile_automatically-19677.html
    function emptyLogFile()
    --local myLogger = import 'LrLogger'( 'Stash' )
    myLogger:disable()
    logPath = LrPathUtils.child(LrPathUtils.getStandardFilePath('documents'), logFilename .. ".log")
    if LrFileUtils.exists( logPath ) then
    local success, reason = LrFileUtils.delete( logPath )
    if not success then
    logger:error("Error deleting existing logfile!" .. reason)
    end
    end
    myLogger:enable( "logfile" )
    end
    Name          getLocationLogFile.
    Purpose          Returns the full path of the current log file.
    function getLocationLogFile()
    return logPath
    end
    local function getPresetFolders()
    -- Get all folders with presets
        local lrPresetFolders = LrApplication.developPresetFolders()
        local presetFolderCache = {}
    local record = {}
        for i, fo in ipairs( lrPresetFolders ) do
    record = {title = fo:getName(), value = fo }
    --record = {title = fo:getName(), value = fo:getName() }
    --myLogger:info( "folder name = " .. fo:getName() )
    table.insert ( presetFolderCache, record )
    end
    --     myLogger:info("Voor de listing")
    --     myLogger:info("preset Folders : " .. inspect (  presetFolderCache ) )
    return presetFolderCache
    end
    local function getPresets ( folderObject )
    local presets = folderObject:getDevelopPresets()
    local presetCache = {}
    local record = {}
    for j, p in ipairs( presets ) do
    record = {title = p:getName(), value = p:getName() }
    --record = {title = p:getName(), value = p:getName() }
    myLogger:info( "getPresets = " .. p:getName() )
    table.insert ( presetCache, record )
    end
    myLogger:info("presets : " .. inspect (  presetCache ) )
    return presetCache
    end
    local function ChoosePreset()
    emptyLogFile()
    local presetFolders = getPresetFolders()
    local currentPresetFolder = presetFolders[1]["value"]
    local presets = getPresets ( currentPresetFolder )
    myLogger:info(presets)
    --     myLogger:info("preset Folders : " .. inspect (  presetFolders ) )
    LrFunctionContext.callWithContext( 'Pop-up example', function( context )
    local f = LrView.osFactory() -- obtain view factory
    local properties = LrBinding.makePropertyTable( context ) -- make prop table
    -- create some keys with initial values
    properties.presetFolder = presetFolders[1]["value"] -- for radio buttons and pop-up menu
    properties.preset = presets[1]["value"]
    properties:addObserver( 'presetFolder', function( properties, key, newValue )
    myLogger:info("Observer - get preset list" )
    currentPresetFolder = properties.presetFolder
    presets = getPresets ( currentPresetFolder )
    myLogger:info(presets)
    myLogger:info("Observer - Preset table: " .. inspect ( presets ) )
    --     Set the new value
    properties.preset = presets[1]["value"]
    myLogger:info("Observer: " .. presets[1]["title"] )
    end )
    --     myLogger:info("presetFolder = " .. properties.presetFolder )
    --     myLogger:info("preset = " .. properties.preset )
    local contents = f:column { -- create view hierarchy
    fill_horizontal = 1,
    spacing = f:control_spacing(),
    bind_to_object = properties, -- default bound table is the one we made
    f:group_box {
    title = "Preset folders",
    fill_horizontal = 1,
    spacing = f:control_spacing(),
    f:popup_menu {
    value = bind 'presetFolder', -- current value bound to same key as static text
    items = presetFolders
    f:static_text {
    fill_horizontal = 1,
    title = bind 'presetFolder', -- bound to same key as current selection
    f:group_box {
    title = "Presets",
    fill_horizontal = 1,
    spacing = f:control_spacing(),
    f:popup_menu {
    value = bind 'preset', -- current value bound to same key as static text
    items = presets
    --     items = getPresets ( currentPresetFolder )
    f:static_text {
    fill_horizontal = 1,
    title = bind 'preset', -- bound to same key as current selection
    local result = LrDialogs.presentModalDialog( -- invoke the dialog
    title = "Select preset",
    contents = contents,
    end
    end
    -- Now display the dialogs
    ChoosePreset()

    That should work because you are likely to be creating a new table each time computeNewItems() executes..
    Sometime the bind function doesn't recognise whether the contents of a table bound to a property changes. So if you use something like this:
    local myItems = computeNewItems() -- compute array of tables with title and value members
    properties['myPresetItems'] = myItems --  assign to bound member of property table.
    it will work the first time. If you then do this:
    myItems = computeNewItems() -- compute array of tables with title and value members but using existing variable
    properties['myPresetItems'] = myItems --  assign to bound member of property table. Change might not be noticed by bind.
    In this instance you would need to reassign the same value again. i.e.
    properties['myPresetItems'] = myItems --  assign to bound member of property table again to force bind to check for table values.
    Setting a property with the same value twice seems to trick bind into checking to see whether you have bound a table. I'm not sure whether this trick is only required on some versions of LR (e.g. LR 2) or only on one of the platforms, but even if it isn't required in LR 5 it will help improve your backwards compatibility and it shouldn't cause any harm to continue using it in LR 5.
    Matt

  • Need Help with Connecting IPad to WiFI E2500 Router

    Have set up Router OK. Created Flashdrive EZ
    How do I connect my IPAD now to WiFi since there is no USB port on my Ipad??

    Although Im not particularly familiar about the significance of Flashdrive EZ to your inquiry, the way to connect your Ipad to your wifi network can be accomplished without using a USB cable. Tap settings and turn on your WIFI. Select your E2500s SSID from the list. If you had set up a security password, type it when required.
    The Search Function is your friend.... and Google too.
    How to Secure your Network
    How to Upgrade Routers Firmware
    Setting-Up a Router with DSL Internet Service
    Setting-Up a Router with Cable Internet Service
    How to Hard Reset or 30/30/30 your Router

  • Need help with connecting

    I just purchased a itouch and when i try to connect to the wireless networks that pop it it will give me the check mark, when i open safari and try to access a web page i.e. google, it tells me safari cant find a server? even when my wireless symbol at the top is full blue? what do i need to do. I purchased it 3 days ago connected it to my laptop and loaded all my songs and some photos, other than that i haven't been able to do anything, no GPS, no itunes or youtube, im getting ready to take it back!

    thanks for the reply, i know if uses the wifi to find me, anytime im around a wireless network say i pull up my networks to connect to and the locked ones i know i cant get to w/o a password, but say its titled (lynksys) it will give me the checkmark and my wifi status will appear in the blue, as to the encryption thing im not sure, right now it says im connected to a hpsetup network, when i go to the settings it shows me the ip address and at the bottom there is an HTTP thing that allows me to select off,manual, or auto. im kinda tech. dumb.

  • Need help with connecting different computers with sockets

    I have made my own code for a chatting application. Basically, i created a Server that listens for connections from the client and then creates a thread to deal with it. When ever a client types in a String, it gets printed on all of the other computers. Right now i can get this code to work if the Server and CLients are on the same computer, when i try connecting on other computers it gives me a Server timed out out and it does not Connect. here is my code:
    Server:
    package talk;
    import java.net.*;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.io.*;
    public class Ap_server {
         public static void main(String[] args) throws IOException {
              ServerSocket serverSocket = null;
              ArrayList<Socket> sockets=new ArrayList<Socket>();
              ArrayList<PrintWriter> out=new ArrayList<PrintWriter>();
              ArrayList<BufferedReader> in=new ArrayList<BufferedReader>();
              ArrayList<String> name=new ArrayList<String>();
              ArrayList<AP_Thread> threads=new ArrayList<AP_Thread>();
              try {
                   serverSocket = new ServerSocket(4831);
              } catch (IOException e) {
                   System.err.println("Could not listen on port: 4831.");
                   System.exit(-1);
              int i=0;
              while(true)
                   sockets.add(serverSocket.accept());
                   in.add(new BufferedReader(
                             new InputStreamReader(
                                       sockets.get(i).getInputStream())));
                   PrintWriter pri=new PrintWriter(sockets.get(i).getOutputStream(), true);
                   AP_Thread temp =new AP_Thread(out,in.get(i),pri);
                   threads.add(temp);
                   pri.println("Please type in your name");
                   name.add(in.get(i).readLine());
                   pri.println("Welcome");
                   out.add(pri);
                   threads.get(i).setn(name.get(i));
                   for(int a=0;a<i;a++)
                        out.get(a).println(name.get(i)+" has joined");
                   threads.get(i).start();
                   i++;
    }Client:
    import java.io.*;
    import java.net.*;
    public class Client {
        public static void main(String[] args) throws IOException {
            Socket kkSocket = null;
            PrintWriter out = null;
            BufferedReader in = null;
            try {
                kkSocket = new Socket("SERVER'S IP ADDRESS", 4831);
                out = new PrintWriter(kkSocket.getOutputStream(), true);
                in = new BufferedReader(new InputStreamReader(kkSocket.getInputStream()));
            } catch (UnknownHostException e) {
                System.err.println("Don't know about host.");
                System.exit(1);
            } catch (IOException e) {
                 e.printStackTrace();
    System.exit(1);
            BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
            String fromServer;
            in_Thread temp= new in_Thread(out,stdIn);
            while ((fromServer = in.readLine()) != null) {
                System.out.println(fromServer);}
            out.close();
            in.close();
            stdIn.close();
            kkSocket.close();
    }If anyone has an ideas about how i can change the code to make it work on different computers, please post it. Thanks!

    Sure. here is the code for AP_Thread:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.ArrayList;
    public class AP_Thread extends Thread {
         ArrayList<PrintWriter> out;
         PrintWriter ou;
         BufferedReader In;
         String name;
         public AP_Thread(
                   ArrayList<PrintWriter> out,BufferedReader In, PrintWriter ou)
              this.out=out;
              this.ou=ou;
              this.In=In;
         public void setn(String s)
              name=s;
         public void run()
                   try
                        while(true)
                        String s;
                        s = In.readLine();
                        if (s == null) {break;}
                        if(s.equals("quit"))
                             out.remove(ou);
                             for(int i=0;i<out.size();i++)
                                  out.get(i).println(name+" has left");
                        else if(out.size()>1&&!s.equals(""))
                             for(int i=0;i<out.size();i++)
                                  if(!ou.equals(out.get(i)))
                                       out.get(i).println(name+": "+s);
                   catch(IOException e){}
    }And here is the code for in_Thread
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.PrintWriter;
    public class in_Thread extends Thread
         PrintWriter out;
         BufferedReader stdIn;
         public in_Thread(
                   PrintWriter out,BufferedReader stdIn)
              this.out=out;
              this.stdIn=stdIn;
              this.start();
         public void run()
              while(true)
                   String fromUser;
                   try {
                        fromUser = stdIn.readLine();
                        if (fromUser != null&&!fromUser.equals("")) {
                             out.println(fromUser);
                        if(fromUser.equals("quit"))
                             out.close();
                             stdIn.close();
                             break;
                   catch (IOException e) {
                        System.err.println("The connection has been closed");
                        break;
    }My guess it that is is an firewall problem because i can get it to work when the client and server on are the same computer.

  • I'm new, please bear with me,  I need help with connecting Airport extreme

    I have been using a Dell desktop pc, running Windows XP for the past few years. I have a dsl modem, (qwest m1000)hooked up for my internet acces. Just bought a new MacPro laptop and the airport extreme. Can I connect the new router to my dsl mdem and have both my desktop and my laptop connect to the internet? If so, how do I do this? thanks for your help!

    Welcome to the Mac side twoo.
    Airport Utility is the program you'll use to connect to and set up your Extreme. What you want to do is pretty straightforward. Airport Utility will take you by the hand in setting it up.
    Power down the DSL modem before you connect it to your Extreme for the first time.

  • I need help with connecting an external HD to Airport Extreme base station

    So i have the base station set up, and it recognizes my hard drive in the airport utilities and have the file sharing turned on, but when i connect to the base station wirelessly from my macbook pro, the hard drive and base station does not show up in the shared section in my finder. Any ideas as to whats up?

    I'm having a similar problem, and I hope you'll excuse my ignorance but is there a difference between rebooting and just restarting. I've done the latter (numerous times) but not the former.
    I have set up my Airport Extreme Base Station to my wireless router (DSL Internet connection) and to an external hard drive (MyBook Essential 640GB with USB connection). Internet works fine.
    When I plug the hard drive directly into my MacBook it recognizes it fine, I can copy files to it, add folders, explore them etc.
    When I plug the hard drive into the Base station, it appears as a network drive on the side bar of my finder window, but when I click on it to open it, it is empty, it shows 0 items and the available memory, but none of the files I put on it are visible to explore.

  • Need help with Connect 4 game, IndexOutOfRangeException was unhandled

    Hi! I've been struggling with this for a while now, the issue is that as soon i move a game piece to the field i get this errorats "IndexOutOfRangeException was unhandled" and i don't know why since my intention with the code was to use for loops
    look through the 2D array thats based on two constants: BOARDSIZEx = 9 and BOARDSIZEy = 6. Instead of traditional 7*6 connect 4 grid i made it 9 squares wide due to having pieces on the side to drag and drop.
    Here's the code for my checkwin:
    public bool checkWin(Piece[,] pieceArray, bool movebool)
    bool found = false;
    //Horizontal
    for (int i = 0; i < BOARDSIZEx - 3; i++)
    for (int j = 0; j < BOARDSIZEy; j++)
    if ((pieceArray[i, j] != null)
    && (pieceArray[i, j] == pieceArray[i, j + 1])
    && (pieceArray[i, j] == pieceArray[i, j + 2])
    && (pieceArray[i, j] == pieceArray[i, j + 3]))
    if (pieceArray[i, j].IsStarter != movebool)
    found = true;
    goto Done; //interesting way of getting out of nested for loop
    //for more on goto: http://stackoverflow.com/questions/324831/breaking-out-of-a-nested-loop
    //Vertikal
    for (int i = 0; i < BOARDSIZEx; i++)
    for (int j = 0; j < BOARDSIZEy - 3; j++)
    if ((pieceArray[i, j] != null)
    && (pieceArray[i, j] == pieceArray[i + 1, j]) && (pieceArray[i, j] == pieceArray[i + 2, j])
    && (pieceArray[i, j] == pieceArray[i + 3, j]))
    if (pieceArray[i, j].IsStarter != movebool)
    found = true;
    goto Done; //interesting way of getting out of nested for loop
    //for more on goto: http://stackoverflow.com/questions/324831/breaking-out-of-a-nested-loop
    //Diagonal, Lower left to upper right
    for (int i = 0; i < BOARDSIZEx - 3; i++)
    for (int j = 0; j < BOARDSIZEy - 3; j++)
    if ((pieceArray[i, j] != null)
    && (pieceArray[i, j] == pieceArray[i + 1, j +1])
    && (pieceArray[i, j] == pieceArray[i + 2, j + 2])
    && (pieceArray[i, j] == pieceArray[i + 3, j + 3]))
    if (pieceArray[i, j].IsStarter != movebool)
    found = true;
    goto Done; //interesting way of getting out of nested for loop
    //for more on goto: http://stackoverflow.com/questions/324831/breaking-out-of-a-nested-loop
    //Diagonal, upper left to lower right
    for (int i = 0; i >= BOARDSIZEx; i--)
    for (int j = 0; j < BOARDSIZEy - 3; j++)
    if ((pieceArray[i, j] != null)
    && (pieceArray[i, j] == pieceArray[i - 1, j + 1])
    && (pieceArray[i, j] == pieceArray[i - 2, j + 2])
    && (pieceArray[i, j] == pieceArray[i - 3, j +3]))
    if (pieceArray[i, j].IsStarter != movebool)
    found = true;
    goto Done; //interesting way of getting out of nested for loop
    //for more on goto: http://stackoverflow.com/questions/324831/breaking-out-of-a-nested-loop
    Done:
    return !found;
    It's at the vertical check that the error occurs and also my checkwin doesnt seem to respond to the call in the game.cs code.
    //check for win
    bool moveBool = true; //returns yes or no depending on whether both players have moved their pieces
    if (move % 2 == 0) moveBool = false;
    bool win = rules.checkWin(pieceArray, moveBool);
    //The game is won!
    if (win)
    string winningPlayerName = player1.Name; //creating a new player instance, just for shortening the code below
    if (moveBool == false) winningPlayerName = player2.Name; //if it was player 2 who won, the name changes
    message = winningPlayerName + " has won the game!\n\n"; //The name of the player
    Board.PrintMove(message); //Print the message
    if (moveBool == true) player1.Score += 1; else player2.Score += 1; //update score for the players
    //The player's labels get their update texts (score)
    Board.UpdateLabels(player1, player2);
    //Here, depending on what one wants to do, the board is reset etc.
    else
    move++; //draw is updated
    And here's a picture on how it looks like at the moment.
    Thanks in Advance!
    Student at the University of Borås, Sweden

    for (int i = 0; i < BOARDSIZEx; i++) // If BOARDSizex is the number of elements in the first dimension...
    for (int j = 0; j < BOARDSIZEy - 3; j++)
    if ((pieceArray[i, j] != null)
    && (pieceArray[i, j] == pieceArray[i + 1, j]) && (pieceArray[i, j] == pieceArray[i + 2, j])
    && (pieceArray[i, j] == pieceArray[i + 3, j])) // Then [i + anything, j] will be out of range.
    You probably meant to add the one, two, or three to the j rather than the i.

Maybe you are looking for

  • How can I transfer game data from one apple device to another?

    I have looked at multiple answers to try to find what I am looking for but I can't fine anything that can help me. I have a 4th gen iPod and I recently got an IPad Mini. I have already set up my iPad and have lots of games on it. Is there any way I c

  • How do I make Flash not look like it's not responding?

    When I run a JSFL script that is pretty intensive and in depth, Flash opens up but doesn't draw itself, and lists "not responding" in the window title bar. My question is how can I make Flash look like it's alive (either have output show up in the ou

  • Macbook pros to TV not working

    I've been connecting my two Macbook pros (2008 & 2011 both on OSX) to a Sony Bravia TV for ages using a HDMI cable connected to a HDMI adaptor to Minidisplay.  For some reason now the connection doesn't work.  I've tried both computers, different HDM

  • Underlining non-English texts

    Dear support team, as a non English user of your admirably super great application , unfortunately I do sometimes fall in some little icky troubles when i want to underline my text, so i get forced to use the pencil tool each time which burns a huge

  • Search engine bug

    Hello, Since I've updated my phone on the latest version of android software 4.4.4 I've noticed a bug in the search engine. If I want to find a specific contact or a specific song in the Walkman app, the phone doesn't recognize the typed letter. If I