Search:

Type: Posts; User: Scotty

Page 1 of 3 1 2 3

Search: Search took 0.07 seconds.

  1. Replies
    1
    Views
    1,930

    [SOLVED] Re: Stopping java in terminal

    Never mind, I just needed to increase the line buffer.
  2. Replies
    1
    Views
    1,930

    [SOLVED] Stopping java in terminal

    Hiya, I have a java exercise I have to do, on which I cannot change the code only add statements. The trouble is, if it gets into an infinite loop the results of the program run off the terminal...
  3. Thread: Minimax

    by Scotty
    Replies
    1
    Views
    1,555

    Minimax

    I am writing a game. If you assume I have the game tree, can you suggest a good minimaxing algorithm. I have one, but it doesnt always work brilliantly. Any suggestions.

    I basicly find the...
  4. Replies
    1
    Views
    1,416

    .add(j, i); not updating array

    The code below works, but index.add(j, i) does not update when highest does? I need to know which ones in the array were selected to be the highest. I have also tried using a variable and using...
  5. Re: Why do these things fail sometimes? Annoying program!

    Sorry it was an example and not typed well. It returns an int


    public int token(int col, int row) {
    return array[col][row] }


    simply
  6. Why do these things fail sometimes? Annoying program!

    Hiya, I have been working on a program that looks for 4 in a line in a 2D array. I have made several methods such as


    if(token(i,j) == token(i+1,j) {
    if(token(i+1,j) == token(i+2,j) {
    ...
  7. Replies
    3
    Views
    3,945

    Re: Deep copy of ArrayList?

    But is it a deep copy? As when I replace the data in the first arrayList (array) then both the arrayLists change. (That or I have another error)
  8. Replies
    3
    Views
    3,945

    Deep copy of ArrayList?

    Does:


    array.add(data.get(y));

    make a deep or shallow copy? I am trying to get an arrayList to collect data but iterating though an algorithm and then place that data into a new arrayList...
  9. Replies
    3
    Views
    1,202

    [SOLVED] Re: Method help, one thing then another - puzzle

    Ive got it now anyway, thanks!
  10. Replies
    3
    Views
    1,202

    [SOLVED] Method help, one thing then another - puzzle

    Problem solved. Sorry dont want to leave notes...
  11. Replies
    3
    Views
    1,152

    Re: method not working outside of class

    I can use other methods, for example



    state.setArray(2);



    Which puts a value in row 2 and then prints the array. These work fine.
    It is definitely initialised. I cannot post code.
  12. Replies
    3
    Views
    1,152

    method not working outside of class

    I have a 2D-array in a class, and methods that affect the array.

    From another class I can call a method to add to the array which works fine.

    My method to get a value from an array is:



    ...
  13. Replies
    3
    Views
    2,758

    Re: Array list returns null

    Sorry, i have used arraylists so much lately i forgot i used an array there.

    Thanks, i will check and see what i get
  14. Replies
    3
    Views
    2,758

    Array list returns null

    In a class (State):




    private int[][] array = board.startArray();


    public int[][] getArray() {
    return array;
  15. [SOLVED] Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    Works now, Thank you! (And I set the classpath so my terminal works in Ubuntu too :)) )
  16. [SOLVED] Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    Build automatically was not selected, but how I have selected it, it looks right. I still get the error though. Anything else I would need to do?
  17. [SOLVED] Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    The command line doesnt work - thats why I am using eclipse. Eclipse suddenly doesnt work...
  18. [SOLVED] Re: at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    All the classes disappeared when I started getting that error - I thought it created the classes when it ran the java files? Or as it went along, as I could also run them from the terminal, but never...
  19. Replies
    3
    Views
    1,477

    [SOLVED] Re: adding to a multidimensional array.

    I am assuming this makes no sense to anyone. Thanks anyway.
  20. [SOLVED] at java.net.URLClassLoader$1.run(URLClassLoader.java: 217) Eclipse

    Eclipse was running running fine, but now I get this error every time I try to compile:



    Exception in thread "main" java.lang.NoClassDefFoundError: DrawConnect4
    Caused by:...
  21. Replies
    1
    Views
    1,417

    Java classes and the 'new' word

    If you have a multidimensional array in a class and some methods. A state class.

    And other classes that built on that:

    State: including your array
    Play
    PlayerTypeA
    PlayerTypeB

    And you had...
  22. Replies
    3
    Views
    1,477

    [SOLVED] Re: adding to a multidimensional array.

    I assume to do with the fact I have GameState gameState = new GameState(); in both player classes, but I get a null pointer exception at move(mov) in both if I take out the new.
  23. Replies
    3
    Views
    1,477

    [SOLVED] Re: adding to a multidimensional array.

    It sets up the board by adding the first elements to the array, but then, because move(mov), is called from different classes:.

    red -- > adds R to the board. yellow --> adds R to a NEW board?!....
  24. Replies
    3
    Views
    1,477

    [SOLVED] adding to a multidimensional array.

    Hiya,

    I am creating a game. I have two player classes, a gameState class and a gamePlay class (and a few other classes).

    -computerPlayer extends Player
    -keyboardPlayer extends Player
    -...
  25. Replies
    2
    Views
    1,432

    How to write this without

    HashSet<String> Cats = map.getAll();
    int numCats = Cats.size()

    I have tried in so many different ways, but I always get an unchecked exception. getAll generates a HashSet.



    int numCats =...
Results 1 to 25 of 60
Page 1 of 3 1 2 3