Search:

Type: Posts; User: pikapo0

Search: Search took 0.13 seconds.

  1. Re: Getting an error! String.charAt(Unknown Source) ???

    thanks for your help so far i just have one last thing as i found the problem and have worked on my code. I can't get my remaining guesses to work properly, i have it set to take 1 off when the...
  2. Re: Getting an error! String.charAt(Unknown Source) ???

    ohh wait i found the problem my word is printing as nothing so ill look for why it is nothing.
  3. Re: Getting an error! String.charAt(Unknown Source) ???

    word is a six letter word from a random list and userLetter is an input between a-z and i've being trying each and every letter
  4. Re: Getting an error! String.charAt(Unknown Source) ???

    I put prints for variables and other things in between the for and if statements and they dont print so it has something to do with the following for loop?




    for(int l = 0; l< word.length();...
  5. Re: Getting an error! String.charAt(Unknown Source) ???

    Uhm it doesn't execute that chunk of code by the looks of it, it just skips right by it like it doesn't exist?

    --- Update ---

    This is my entire code so far:


    /* Author: Brendon Drury
    *...
  6. Re: Getting an error! String.charAt(Unknown Source) ???

    thanks for that. but know my program just ends when i get to that point so idk.
  7. Re: Getting an error! String.charAt(Unknown Source) ???

    So what would i write as the method then?
  8. Re: Getting an error! String.charAt(Unknown Source) ???

    The length of word is always 6 and when i try use word.length it gives me an error saying cant find symbol: variable length for this :

    for(int i = 0; i< word.length; i++){

    ...
  9. Re: Getting an error! String.charAt(Unknown Source) ???

    java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at java.lang.String.charAt(String.java:686)
    at Hangman.userGuess(Hangman.java:130)
    at Hangman.main(Hangman.java:39)
    at...
  10. Re: Getting an error! String.charAt(Unknown Source) ???

    Even that still gives me the error. I'm wondering if it has anything to do with variable "i" being automatically bigger than my word before it can run through?
  11. Getting an error! String.charAt(Unknown Source) ???

    I'm getting an error i really don't know why:

    ERROR:

    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
    at java.lang.String.charAt(Unknown...
Results 1 to 11 of 11