Search:

Type: Posts; User: Gugubo

Search: Search took 0.12 seconds.

  1. Re: How do I get a list of words for a Scrabble-game

    Is a string array with 500-1000 words read out of a file possible? Where can I get such a file.
  2. How do I get a list of words for a Scrabble-game

    If I wanted to make a game like Scrabble in Java, how could I include all the words?
    Is there a way to import them or so? How do I do that? Is this even possible?
  3. Replies
    6
    Views
    1,036

    [SOLVED] Re: Changing whole array

    I tried your suggestion in post 4, but apparently I typed it in a bit wrong.

    Tried it again and it works. Thanks!
  4. Replies
    6
    Views
    1,036

    [SOLVED] Re: Changing whole array

    Maybe I'll rephrase.

    So this is my code:


    String[] stringArray = {"hello","world","test","whatever"};
    System.out.println("stringArray: "+ java.util.Arrays.toString(stringArray));...
  5. Replies
    6
    Views
    1,036

    [SOLVED] Re: Changing whole array

    Eclipse gives an error: "Array constants can only be used in initializers." in this line:

    stringArray = {"banana","fish","tree","apple"};
  6. Replies
    6
    Views
    1,036

    [SOLVED] Changing whole array

    How can I change a complete array when it's already initialized?

    Can I change this array:

    String[] stringArray = {"hello","world","test","whatever"};

    to this:
    ...
  7. Replies
    1
    Views
    1,048

    double doesn't show decimal places

    This:


    double test = 100/3;
    System.out.print(test);
    gives as output 33.0. Isn't it supposed to output 33.3333...?
    Am I missing something?
  8. Thread: Random String

    by Gugubo
    Replies
    4
    Views
    1,152

    Re: Random String

    yep, doing that now already. Apparently I forgot about arrays. Thanks anyway.
  9. Thread: Random String

    by Gugubo
    Replies
    4
    Views
    1,152

    Random String

    What's the easier way to get a random string?
    At the moment I would use:



    Random number = new Random();
    numberR = number.nextInt(2)+1;
    if (numberR==1){
    System.out.println("Hi.");
    }
  10. Thread: Random String

    by Gugubo
    Replies
    4
    Views
    1,152

    Random String

    Nevermind
  11. Replies
    3
    Views
    1,122

    [SOLVED] Re: What's wrong with this program?

    Glad, I could help. :)
  12. Replies
    3
    Views
    1,122

    [SOLVED] Re: What's wrong with this program?

    You forgot the dot between System and out.
    Also post code inside code tags:


    import java.io.*;
    import java.util.Scanner;
    class Main {
    public static void main (String[] args) throws...
  13. Replies
    2
    Views
    1,229

    Re: stopping a while loop with user input

    It's only console. Thanks, I'll try to use JOptionPanes.
  14. Replies
    2
    Views
    1,229

    stopping a while loop with user input

    How could I create this programm: If you start it, a loop tells something (say every 5 seconds) until you type in 'stop'.
    The problem is, if I type in .nextLine(); it checks every time the loop...
  15. defaultCloseOperation doesn't work plus JButttons don't show up

    So I've got the following code:


    import java.awt.*;
    import javax.swing.*;


    public class testframe extends JFrame{

    private JButton play;
  16. Re: is there a jumptoLine(); function or is there a way to implement it.

    maybe... May I ask what's an IDE?
  17. is there a jumptoLine(); function or is there a way to implement it.

    It would be realy useful to just type in jumptoLine(12); and it goes to that line. Now is there something to do so?
  18. Replies
    6
    Views
    1,550

    Re: I don't even know whats wrong.

    Thanks for helping me, GregBannon, but I hadn't read your comment since now. And by now I already know the equals method. I btw changed the programm so it auto repeats itself after you got the right...
  19. Replies
    2
    Views
    2,720

    Re: if (x.equals("Hello")) or "World"

    Thanks :)

    Helped me!
  20. Replies
    2
    Views
    2,720

    if (x.equals("Hello")) or "World"

    if (x = y != z)

    tests if x is equal to y OR z.
    How do I do this for .equals?

    like:

    if (x.equals("Hello" or "World")
  21. Replies
    6
    Views
    1,550

    Re: I don't even know whats wrong.

    I didn't want to copy it, because it's so long...

    The programm runs fine until I get the number right. Then the conosle outputs:


    Again? Type in yes or no.

    Again? Type in yes or no.
    ...
  22. Replies
    6
    Views
    1,550

    I don't even know whats wrong.

    So I wanted to make a simple number guessing game, which worked fine. Then I wanted to add a play again function, but... I get errors. Why? Here's the code:


    import java.util.*;

    public class...
  23. Replies
    4
    Views
    1,397

    Re: What language to use?

    thanks :) you really helped me out a lot.

    now that's not important, but how long do you think would/will it take to learn java until I can create a small game?
  24. Replies
    4
    Views
    1,397

    .

    .
Results 1 to 24 of 24