FL8: Array.sortOn() nur mit indiziertem Array?!

Hi,
normalerweise w�rde ich das nicht fragen, aber ich
habe gerade Schwierigkeiten mit
Array.sortOn() und da hab ich mir die Hilfe nochmal ganz
genau angesehen, da steht:
"sortOn (Array.sortOn-Methode)
Sortiert die Elemente in einem Array nach einem oder mehreren
Feldern im Array. Das Array
muss folgende Merkmale aufweisen:
Es handelt sich um ein indiziertes und kein assoziatives
Array."
Mhm, ich dachte eigentlich, dass die Methode sort()
ausschlie�lich f�r indizierte Arrays
einsetzbar ist und die Methode sortOn() gerade f�r
assoziative Arrays geeignet ist.
Ist da etwas falsch beschrieben oder hab ich was falsch
verstanden?
var myArray:Array = new Array({x:10,y:20});
Das ist doch ein assoziatives Array und dass w�rde ich
so sortieren.
myArray.sortOn("x",16);
Gr��e
Nick Weschkalnies
Web ||
http://www.medianetic.de
Blog ||
http://www.blog.medianetic.de

Nick Weschkalnies schrieb:
> Mhm, ich dachte eigentlich, dass die Methode sort()
ausschlie�lich f�r
> indizierte Arrays einsetzbar ist und die Methode
sortOn() gerade f�r
> assoziative Arrays geeignet ist.
> Ist da etwas falsch beschrieben oder hab ich was falsch
verstanden?
>
> var myArray:Array = new Array({x:10,y:20});
>
> Das ist doch ein assoziatives Array und dass
w�rde ich so sortieren.
>
> myArray.sortOn("x",16);
>
So, jetzt erg�nze ich den Thread mal um mein
wirkliches Problem:
W�re nett, wenn sich jemand die Zeit nimmt, sich das
anzuschauen:
http://www.medianetic.de/mmng/Liniendiagramm.zip
Ich frage das jetzt nochmal explizit, da ich wirklich keinen
Fehler finde und schon
jemanden fachkundigen drauf angesetzt habe, der aber auch ins
Gr�beln gekommen ist.
Zur Erl�uterung:
Gibt erstmal einfach z.B. folgender Werte ein:
F�r X: 0,0,0,0 und Y: 6666,66,777,42
Dann tracert er als h�chsten Wert des nach Y
sortierten Arrays: "777"
Ich werd hier fast verr�ckt, weil er manchmal bei
anderen Werten mir das Array richtig zu
sortieren scheint. Irgendwas stimmt da �berhaupt
nicht.
Die for-Schleife hab ich nur zum Testen gemacht, eigentlich
sollte es auch mit dem
Auskommentierten Code funktionieren.
Wer wei� was? ;)
Gr��e
Nick Weschkalnies
Web ||
http://www.medianetic.de
Blog ||
http://www.blog.medianetic.de

Similar Messages

  • Speichern in Arrays und anschließend die Arrays vergleichen.

    Es handelt sich also um ein geregeltes System mit einem DC Motor.
    Motor läuft am Anfang ohne Last und später mit Last im Loop. Ich möchte diese 2 Arten miteinander vergleichen, genauer gesagt die 2 elektrische kräfte des Motors.
    OHNE LAST: Die Frage ist also wie soll das am einfachsten passieren? Ich habe mir gedacht dass
    es am besten ist Lauf des Motors OHNE Last in ein Array und dann in eine Datei zu speichern.
    Dabei denke ich an Array oder Map (also Key ist Frequenz des Motors die in 1-er schritten erhöht wird und Value ist einfach die Kraft des Motors bei dieser Frequenz.
    MIT LAST: Wenn ich jetzt diese Datei habe, möchte ich ein Lauf MIT Last starten. Hier wird auch die Frequenz
    in 1-er Schritten
    erhöht und der aktuelle Wert der Kraft mit der Kraft des Motors ohne Last verglichen unddie Differenz angezeigt.
    Kann mir jemand bitte tipps geben wie genau ich das machen soll, also wie man die Werte in Arrays speichert, wie man die Arrays vergleicht usw., oder vielleicht sogar ein kleines .vi Beispiel?
    Danke im Voraus
    Vedran Divkovic
    PY RUB

    Sorry, my German is a bit rusty. One solution would be to design the program as a simple state machine and store the Load and NoLoad result in a shift register each.
    See attached example. Let me know if this is what you meant.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Load.vi ‏114 KB

  • Converting object wrapper type array into equivalent primary type array

    Hi All!
    My question is how to convert object wrapper type array into equivalent prime type array, e.g. Integer[] -> int[] or Float[] -> float[] etc.
    Is sound like a trivial task however the problem is that I do not know the type I work with. To understand what I mean, please read the following code -
    //Method signature
    Object createArray( Class clazz, String value ) throws Exception;
    //and usage should be as follows:
    Object arr = createArray( Integer.class, "2%%3%%4" );
    //"arr" will be passed as a parameter of a method again via reflection
    public void compute( Object... args ) {
        a = (int[])args[0];
    //or
    Object arr = createArray( Double.class, "2%%3%%4" );
    public void compute( Object... args ) {
        b = (double[])args[0];
    //and the method implementation -
    Object createArray( Class clazz, String value ) throws Exception {
         String[] split = value.split( "%%" );
         //create array, e.g. Integer[] or Double[] etc.
         Object[] o = (Object[])Array.newInstance( clazz, split.length );
         //fill the array with parsed values, on parse error exception will be thrown
         for (int i = 0; i < split.length; i++) {
              Method meth = clazz.getMethod( "valueOf", new Class[]{ String.class });
              o[i] = meth.invoke( null, new Object[]{ split[i] });
         //here convert Object[] to Object of type int[] or double[] etc...
         /* and return that object*/
         //NB!!! I want to avoid the following code:
         if( o instanceof Integer[] ) {
              int[] ar = new int[o.length];
              for (int i = 0; i < o.length; i++) {
                   ar[i] = (Integer)o;
              return ar;
         } else if( o instanceof Double[] ) {
         //...repeat "else if" for all primary types... :(
         return null;
    Unfortunately I was unable to find any useful method in Java API (I work with 1.5).
    Did I make myself clear? :)
    Thanks in advance,
    Pavel Grigorenko

    I think I've found the answer myself ;-)
    Never thought I could use something like int.class or double.class,
    so the next statement holds int[] q = (int[])Array.newInstance( int.class, 2 );
    and the easy solution is the following -
    Object primeArray = Array.newInstance( token.getPrimeClass(), split.length );
    for (int j = 0; j < split.length; j++) {
         Method meth = clazz.getMethod( "valueOf", new Class[]{ String.class });
         Object val = meth.invoke( null, new Object[]{ split[j] });
         Array.set( primeArray, j, val );
    }where "token.getPrimeClass()" return appropriate Class, i.e. int.class, float.class etc.

  • Creating array of references to another array's elements

    I have been coached by NI support to read an array of picture files into an array of picture indicators and then in order to save memory, establish an array of references to the array of picture indicators' elements so that I can use them in a subsequent loop.    Does anyone know a quick way to create this array of references from an array of picture indicators? 
    Solved!
    Go to Solution.

    My understanding is there is only one reference to an array element.  There is no such thing as references to different array elements.
    Why wouldn't you use a reference to the array, use the value property node, then use index array to get out the picture you are interested in?

  • How to build a cluster array dynamically from another cluster array?

    I'm working on a problem where I seem to be getting lost in a sea of
    possibilities, none of which strikes me as optimum. Here's what I need to do.
    I've got an input array of clusters (ARR1). Each cluster contains the
    following components: an integer (INT1), a ring variable (RING1), a boolean
    (BOOL1) and a cluster which itself is simply a bunch of ring variables
    (CLUST1) Now, I need to transform that into a set of clusters (CLUST3) each of
    which contains an array of characters (CHARARY2), a copy of the ring variable
    (RING2), a copy of the boolean variable (BOOL2) and a copy of the cluster
    (CLUST2).
    To build the CLUST3, I need to find all elements within ARR1 that have the
    same unique combination of RING1 and BOOL1, and if BOOL1 is True, then RING1
    in addition, build an array of all the INT1 values corresponding to each
    unique combination above converted to character, and then bundle this array
    plus the unique combination of the other variables into a new cluster. In
    general I could have several such clusters.
    So if I had the following array to start with:
    Index INT1 RING1 BOOL1 CLUST1
    0 3 1 F {Values1}
    1 2 1 T {Values2}
    2 4 0 F {Values1}
    3 6 0 F {Values3}
    4 1 2 T {Values2}
    5 4 2 T {Values2}
    6 3 0 T {Values3}
    7 4 2 T {Values3}
    I should end up with the following clusters:
    CHARARY2 RING2 BOOL1 CLUST1
    "3" 1 F Don't care
    "2" 1 T {Values2}
    "4","6" 0 F Don't care
    "1","4" 2 T {Values2}
    "3" 0 T {Values3}
    "4" 2 T {Values3}
    What methods would you suggest for accomplishing this easily and efficiently?
    Alex Rast
    [email protected]
    [email protected]

    Tedious but not conceptually difficult.
    ARR1 goes into a for loop, auto indexed on the FOR loop. The for loop has a
    shift register which will be used to build the output array. Nested within
    the for loop is another for loop, which the shift register array goes into,
    again auto indexed, along with the element that has been auto-indexed from
    ARR1. This for loop has a shift register, initialised with a boolean "true".
    The inner loop compares the current element of ARR1 with the output array
    and if an element in the output array is already present which matches the
    input by your criteria, then the boolean register is set false; otherwise it
    is left alone.
    After the nested FOR loop you have a case fed from the boolean shift
    register; if the boolean is true, the new element is unique and should be
    added to the array. If it is false then a previous element has been found
    making the present one redundant, and the array should be passed through
    without adding the element.
    In the true case, you simply unbundle the original element into its
    components and build the new element, using "build array".
    Notes for if the above is easy for you;
    1) if handling lots of data then pre-initialise the shift register of your
    outer loop with the same number of elements as your input array. Use
    "Replace Array Subset" instead of "Build Array" to insert the current
    element into the pre-allocated memory rather than having to create a new
    array and copy all the current data across, which is what "Build Array" is
    doing. Use "Array Subset" at the end to obtain a new array containing just
    the elements you've used, removing the unused ones at the end.
    2) Again for large datasets- the use of a while loop instead of the inner
    for loop is more efficient since you can halt the while loop as soon as a
    duplicate is found. With the described approach you have to go through the
    whole array even if the first element turns out to be a duplicate- much
    wasted computer time.
    Alex Rast wrote in message
    news:[email protected]...
    > I'm working on a problem where I seem to be getting lost in a sea of
    > possibilities, none of which strikes me as optimum. Here's what I need to
    do.
    >
    > I've got an input array of clusters (ARR1). Each cluster contains the
    > following components: an integer (INT1), a ring variable (RING1), a
    boolean
    > (BOOL1) and a cluster which itself is simply a bunch of ring variables
    > (CLUST1) Now, I need to transform that into a set of clusters (CLUST3)
    each of
    > which contains an array of characters (CHARARY2), a copy of the ring
    variable
    > (RING2), a copy of the boolean variable (BOOL2) and a copy of the cluster
    > (CLUST2).
    >
    > To build the CLUST3, I need to find all elements within ARR1 that have the
    > same unique combination of RING1 and BOOL1, and if BOOL1 is True, then
    RING1
    > in addition, build an array of all the INT1 values corresponding to each
    > unique combination above converted to character, and then bundle this
    array
    > plus the unique combination of the other variables into a new cluster. In
    > general I could have several such clusters.
    >
    > So if I had the following array to start with:
    >
    > Index INT1 RING1 BOOL1 CLUST1
    > ---------------------------------------------------
    > 0 3 1 F {Values1}
    > 1 2 1 T {Values2}
    > 2 4 0 F {Values1}
    > 3 6 0 F {Values3}
    > 4 1 2 T {Values2}
    > 5 4 2 T {Values2}
    > 6 3 0 T {Values3}
    > 7 4 2 T {Values3}
    >
    > I should end up with the following clusters:
    >
    > CHARARY2 RING2 BOOL1 CLUST1
    > -----------------------------------------------------
    > "3" 1 F Don't care
    > "2" 1 T {Values2}
    > "4","6" 0 F Don't care
    > "1","4" 2 T {Values2}
    > "3" 0 T {Values3}
    > "4" 2 T {Values3}
    >
    > What methods would you suggest for accomplishing this easily and
    efficiently?
    >
    > Alex Rast
    > [email protected]
    > [email protected]

  • How can I resize an array directly (without using reshape array)?

    Hi everyone,
    I have a porgam in which I am using an array as a command (with specific values that the user enters before running the program). By mistake, at the beginning I created a 4 dimension array (for instance), but I didn't know because I was only showing the first 3 values (not expanding the array to 4 or more). I would now like to change the size of the array from 4 to 3. I don't seem to be able to find an option (right clicking on the array) that enables me to do this directly. I don't want to use the "reshape array" icon, because this is not what I want to do. I hope I am clear enough.
    Thanks for any help,
    regards,
    Marc
    Solved!
    Go to Solution.
    Attachments:
    Forum array.vi ‏7 KB

    HI,
              If i have understood your question hope this helps you. If you want to change the size of the array right click on the array element and click Data Operations>Delete Element or if you want to do programmatically delete the particular element.
    Attachments:
    Forum%20array[1].vi ‏11 KB

  • How can I inverse the Split 1D Array by recombining the splitting array?

    How can I inverse the Split 1D Array by recombining the splitting array? i.e I have two boolean arrays A and B, and I want them in one boolean array: A array elements followed by B elements (NOT Interleaving)
    Thank you
    Solved!
    Go to Solution.

    Thank you Marcus_Körner , GerdW and thoult for your assistance.
    Sorry I am using Labview 2013, so I saved it in ver 2010 format, and I uploaded a photo for the circuit.
    Attachments:
    Packets.vi ‏8 KB
    Untitled.png ‏5 KB

  • Mein Apple TV (3.Gen. Softw. 7.x) passt sich nicht an das 16:9 Bildformat des Fernsehers an. 16:9-Inhalte werden nur mit 4 großen schwarzen Rändern dargestellt.

    Mein neu gekauftes AppleTV stellt den iPad-Bildschirm (außer bei Videos) nur im 4:3-Format dar. D.h. meine 16:9-Fotos und alle 16:9-Inhalte werden auf meinem 16:9 Fernseher nur mit 4 breiten schwarzen Rändern dargestellt. Fotos, die 10 MPixel haben, haben dann nicht nur die 2 MPixel des Fernsehers, sondern etwa 0,5 MPixel. Das ist sehr enttäuschend. Steht zu erwarten, dass es eine neue AppleTV-Generation gibt, die diese Schwäche nicht mehr hat?

    com.kaspersky.kext.kimul.44     44
    com.kaspersky.nke   1.0.1d41
    com.kaspersky.kext.klif              3.0.0d23
    Uninstall the Kaspersky anti virus software. Instructions here > How to uninstall Kaspersky Security for Mac
    Then restart your Mac.
    Kaspersky has caused other Mac users kernel panics as well noted from the result of an Apple Support Communities search here.
    If you want to use anti virus software on your Mac, install Sophos (free) as recommended here.

  • How to insert an array of number in the array of cluster

    hello, I have a question. How to put an array of numeric into an array of clusters which have different types of element?
    Could you please show me in my vi?
    Attachments:
    program1.vi ‏7 KB

    It appears you didn't actually try anything. Have you done any LabVIEW tutorials? You can autoindex the array of clusters and use Bundle by Name. This assumes, of course, that the number of elements in the two arrays is the same. I would write it for you, but you will learn far more if you try it yourself first. If you don't know what autoindexing is, check the LabVIEW Help and the examples. Don't know what Bundle By Name is? Again, check the LabVIEW Help and the examples.
    To learn more about LabVIEW it is recommended that you go through the introduction material, tutorial(s), and other material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. There are also several Technical Resources. You can also take the online courses for free.

  • Ich möchte in Photoshop auf eingescannte Chornoten Noten-Korrekturen vornehmen. Ich habe dafür die Schrift "Sonata" gekauft, um festzustellen, dass dieser font nur mit entsprechenden Musikprogrammen funktioniert. Wie kann ich Musiknoten in Photoshop einfü

    Ich möchte in Photoshop auf eingescannte Chornoten Noten-Korrekturen vornehmen. Ich habe dafür die Schrift "Sonata" gekauft, um festzustellen, dass dieser font nur mit entsprechenden Musikprogrammen funktioniert. Wie kann ich Musiknoten in Photoshop einfügen? Vielen Dank für Tipps.

    Ich habe folgende Lösung gefunden: Ich habe mir die Glyph Complement PDF-Datei zum Font Sonata gespeichert und in Photoshop geöffnet. In Photoshop erscheinen die Noten auf einem transparenten Hintergrund. Damit kann ich mit Copy & Paste die Noten auf ein in PS geöffnetes Notenblatt einfügen. Die einzelne Noten oder das gesamte Notenblatt können entsprechend der erforderlichen Größe skaliert werden. Dieser Weg ist sicherlich nicht für das Erstellen von ganzen Notenblättern geeignet, aber für kleinere "Reparaturen" durchaus genügend. Vielen Dank für die Anregungen, die mich letztlich auf diese Idee gebracht haben.

  • PageMaker 7.0: Hilfe nur mit Internet Explorer?

    Hallo,
    nach längerer Bedenkzeit und einigen erfolglosen Lösungsvorschlägen teilte mir der Adobe Support mit, dass die Hilfe des PageMaker 7.0 nur mit dem Internet Explorer funktioniere ("Pagemaker wurde weit vor den aktuellen Browser-Versionen entwickelt") und ich als Workaround in meinem Browser (Firefox) ein Lesezeichen auf die Hilfe-Datei setzen solle. Ich wüsste nur gerne, ob jemand dieselbe oder die gegenteilige Erfahrung gemacht hat.
    Dank und Gruß,
    Anselm

    Would it be possible for you to generate a crash dump (dmp) and send it to [email protected]?   I'd like to look into this asap.
    Thanks,
    Chris

  • Append variable and array items after a record array search

    I would like to update a variable and array item after a record array search, and wanted to know what would be the best way of carrying it out in Javascript.
    In this case, if a match is found between the variable and area item, then the postcode item should be appended to the variable.
    The same needs to be done for the array items, but I reckon that a for loop would work best in this scenario, as each individual item would need to be accessed somehow.
    Btw due to the nature of my program, there will always be a match. Furthermore, I need to be able to distinguish between the singleAddress and multipleAddresses variables.
    Hopefully this code explains things better:
    // before search
    var singleAddress = "Mount Farm";
    var multipleAddresses = ["Elfield Park", "Far Bletchley", "Medbourne", "Brickfields"];
    // this is the record which the search needs to be run against
    plot = [{
    postcode: "MK1",
    area: "Denbigh, Mount Farm",
    postcode: "MK2",
    area: "Brickfields, Central Bletchley, Fenny Stratford, Water Eaton"
    postcode: "MK3",
    area: "Church Green, Far Bletchley, Old Bletchley, West Bletchley",
    postcode: "MK4",
    area: "Emerson Valley, Furzton, Kingsmead, Shenley Brook End, Snelshall West, Tattenhoe, Tattenhoe Park, Westcroft, Whaddon, Woodhill",
    postcode: "MK5",
    area: "Crownhill, Elfield Park, Grange Farm, Oakhill, Knowlhill, Loughton, Medbourne, Shenley Brook End, Shenley Church End, Shenley Lodge, Shenley Wood",
    // after search is run then:
    // var singleAddress = "Mount Farm, MK1"
    // var multipleAddresses = ["Elfield Park, MK5", "Far Bletchley, MK3", "Medbourne, MK5", "Brickfields, MK2"]
    Fiddle here

    I would like to update a variable and array item after a record array search, and wanted to know what would be the best way of carrying it out in Javascript.
    In this case, if a match is found between the variable and area item, then the postcode item should be appended to the variable.
    The same needs to be done for the array items, but I reckon that a for loop would work best in this scenario, as each individual item would need to be accessed somehow.
    Btw due to the nature of my program, there will always be a match. Furthermore, I need to be able to distinguish between the singleAddress and multipleAddresses variables.
    Hopefully this code explains things better:
    // before search
    var singleAddress = "Mount Farm";
    var multipleAddresses = ["Elfield Park", "Far Bletchley", "Medbourne", "Brickfields"];
    // this is the record which the search needs to be run against
    plot = [{
    postcode: "MK1",
    area: "Denbigh, Mount Farm",
    postcode: "MK2",
    area: "Brickfields, Central Bletchley, Fenny Stratford, Water Eaton"
    postcode: "MK3",
    area: "Church Green, Far Bletchley, Old Bletchley, West Bletchley",
    postcode: "MK4",
    area: "Emerson Valley, Furzton, Kingsmead, Shenley Brook End, Snelshall West, Tattenhoe, Tattenhoe Park, Westcroft, Whaddon, Woodhill",
    postcode: "MK5",
    area: "Crownhill, Elfield Park, Grange Farm, Oakhill, Knowlhill, Loughton, Medbourne, Shenley Brook End, Shenley Church End, Shenley Lodge, Shenley Wood",
    // after search is run then:
    // var singleAddress = "Mount Farm, MK1"
    // var multipleAddresses = ["Elfield Park, MK5", "Far Bletchley, MK3", "Medbourne, MK5", "Brickfields, MK2"]
    Fiddle here

  • Getting an array to print into another array.

    Hi all. So after an illness and other things i had enough time to think about my project. I decided i was going about it a more complicated way than what was needed. So now i've began work again. I felt lik i was getting along nicely until i had trouble printing my Snake array into my Grid 2D array.
    If anyone can help me with the error and why i cannot print the snake onto the grid that would be great?
    Thanks.
    Grid Class:
    import java.lang.*;
    public class Grid
         public static void main(String[] args)
              //Final int of ROWS and COLS for the grid size
              final int ROWS = 33;
              final int COLS = 33;
              // int counter will be used to display the grid
              int counter = 0;
              //Create new String array called Grid
              String[][] Grid = new String[ROWS][COLS];
              //new Food, Snake and Catcher
              Food Fd = new Food();
              Snake Sn = new Snake();
              Catcher cat = new Catcher();
              //Nested for loops to display the grid
              for (int i =0; i < Grid.length; i++)
                       for (int j = 0; j < Grid[0].length; j++)
                      Grid[i][j] = " ";
                        Grid[0] = "|";
                        Grid[i][32] = "|";
                        Grid[0][j] = "-";
                        Grid[32][j] = "-";
                        Grid[12][12] = Fd.food;//Print food F onto grid
                        Grid[15][15] = Sn.snake;//Print snake onto grid (NOT WORKING YET!!)
                        Grid[5][10] = cat.catcher;//print catcher on grid
                        System.out.print(Grid[i][j]);//Prints grid
                        counter = counter + 1;
                        if(counter == 33)
                             counter = 0;
                             System.out.println("");
    Snake Class:import java.lang.*;
    public class Snake
         public static void main(String[] args)
              final int Snake = 20;
              String[] snake = new String[Snake];
                   for (int h =0; h < snake.length; h++)
                             snake[0] = "+";
                             snake[1] = "*";
                             snake[2] = "*";
                             snake[3] = "*";
                             System.out.println(snake[h]);
    }Error:Grid.java:28: cannot find symbol
    symbol : variable snake
    location: class Snake
    Grid[15][15] = Sn.snake;
    ^
    1 error                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    I have looked at it but im afraid i dont quite understand what your trying to say. I have edited my code a bit and removed the snake array, now its just a String "H"
    I've tried to get it to move but the code i entered doesn't seem quite right.
    Here is my new code so far.
    import java.lang.*;
    public class Grid
         public static void main(String[] args)
              //Final int of ROWS and COLS for the grid size
              final int ROWS = 33;
              final int COLS = 33;
              char move;
              // int counter will be used to display the grid
              int counter = 0;
              //Create new String array called Grid
              String[][] Grid = new String[ROWS][COLS];
              //new Food
              Food Fd = new Food();
              Score myScore = new Score();
              Snake sn = new Snake();
              Keyboard kb = new Keyboard();
              //Nested for loops to display the grid
              for (int i =0; i < Grid.length; i++)
                       for (int j = 0; j < Grid[0].length; j++)
                      Grid[i][j] = " ";
                        Grid[0] = "#";
                        Grid[i][32] = "#";
                        Grid[0][j] = "#";
                        Grid[32][j] = "#";
                        Grid[Fd.fdx][Fd.fdy] = Fd.food;//Print food F onto grid
                        Grid[sn.snakeHeadX][sn.snakeHeadY] = sn.snakeHead;
                        System.out.print(Grid[i][j]);//Prints grid
                        counter = counter + 1;
                        if(counter == 33)
                             counter = 0;
                             System.out.println("");
              System.out.println("Score: "+myScore.Score);
              System.out.println("Please Enter either w,a,s,d to move up, left, down, right accordingly: ");
              move = kb.readChar();
              if (move = w)
                   sn.snakeHeadY++;
              else if (move = s)
                   sn.snakeHeadY--;
              else if (move = a)
                        sn.snakeHeadX--;
              else if (move = d)
                        sn.snakeHeadX++;
              else
                   System.out.println("Invalid move!");
    }import java.lang.*;
    public class Snake
              String snakeHead = "H";
              int snakeHeadX = 15;
              int snakeHeadY = 15;
              char move;
    }They print out this error,Grid.java:50: cannot find symbol
    symbol : variable w
    location: class Grid
    if (move = w)
    ^
    Grid.java:50: incompatible types
    found : char
    required: boolean
    if (move = w)
    ^
    Grid.java:54: cannot find symbol
    symbol : variable s
    location: class Grid
    else if (move = s)
    ^
    Grid.java:54: incompatible types
    found : char
    required: boolean
    else if (move = s)
    ^
    Grid.java:58: cannot find symbol
    symbol : variable a
    location: class Grid
    else if (move = a)
    ^
    Grid.java:58: incompatible types
    found : char
    required: boolean
    else if (move = a)
    ^
    Grid.java:62: cannot find symbol
    symbol : variable d
    location: class Grid
    else if (move = d)
    ^
    Grid.java:62: incompatible types
    found : char
    required: boolean
    else if (move = d)
    ^
    8 errors                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • PDF Datei nur mit Adobe öffnen lassen

    Hallo
    Seit geraumer Zeit arbeite ich an einem Tool für Budget Offerten, dass auf PDF basiert. Das Tool hat ein paar Navigations Seiten und dann die entsprechenden Datein mit den Offerten. Um das ganze aufzubauen habe ich den Adobe Acrobat Pro benutzt. Dabei habe ich für z.B. bei de Datein eingestellt, dass sie immer auf der ersten Seite, Fit Page und Single Page öffnen sollen. Das funktioniert soweit alles ganz toll und es fühlt sich doch wie ein "richtiges" Programm an. Es gibt jedoch ein Problem, wenn ich das Tool nun mit dem PDF X-Change Viewer öffne, dann sind einige Einstellungen nicht mehr wirksam und das Tool kommt anders daher. Zudem müsst ihr wissen, dass das Tool verschiedenen Mitarbeitern verteilt wird. Gibt es die Möglichkeit im PDF Adobe Acrobat einzustellen, dass es nur mit Adobe Reader und Adobe Acrobet etc. geöffnet werden kann, nicht aber mit dem PDF Viewer? Ich habe bis anhin nichts derartiges gefunden.
    Ich danke euch für die Hilfe.

    Womit eine Datei geöffnet wird ist Sache des Betriebssystems.
    Das heißt, die Auswahl des Standardprogramms muss bei jedem Rechner individuell eingestellt werden.
    MfG
    us-hh

  • Kann man wirklich nur mit Kreditkarte Apps kaufen?

    Was machen Leute - wie ich zum Beispiel -, die keine Keditkarte haben? Kann man nicht auch per Bankeinzug kaufen? Wenn ja, wo finde ich die Einstellung? Finde nur Kreditkarte. Das wäre ein Riesen Minus für Apple.

    Man kann wirklich nur mit Kreditkarte Apps kaufen, das tut mir leid für Leute die keine Kreditkarte haben... Ich habe keine Kreditkarte, aber ich benutze meines Vater Kreditkarte. Ich kaufe Cadeaucards und ich aktiviere Cadeaukards auf mein account, so ich habe Kredit auf mein account.
    Sorry for this bad German, I hope you understand it

Maybe you are looking for

  • Document Distribution limited to 999

    Hi All, We are creating a document distribution list for the entire company (+-2000 users). When we distribute to the list only the first 999 distributions go through succesfully, the rest fail. Has any one else had this issue before? Thanks Warren B

  • "error in loading page"

    I have a new Satellite L655-S5150 that, when I click on a website (home, etc), it goes to the error page that says it cannot load due to a connection problem.  I can get it to load by clicking on the website again, sometimes 3 times.  I've enabled th

  • Could not update software, showing usage

    Fixes an issue in iOS 8.0.1

  • CRM in Oracle E_BUSINESS suite

    Hi, are there any products or modules for CRM in Oracle E_BUSINESS suite (Oracle APPLICATIONS)? If yes which ones ? Many thanks.

  • Data_Transfer and Database size.

    Hello all, I am using a Data_Transfer transform to speed up job performance. My question is that if I use these transforms will database size increase by a larger percentage than if not using it. And if so are there options that I can select to limit