Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    Before trying to write code, you should work on the logic for the program. Work on making a list of the steps the program should do in pseudo code. When the logic looks good, then try writing the...
  2. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    How will you detect when testing the end of the sequence of letters? With this String: "bazyx" you will need to know when at the end of the sequence to know to wrap around to the end of the...
  3. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    Instead of using 'a' in the code that tests for the first char of the group of letters: a-z or digits: 0-9, use a variable of type char that holds either 'a' or '0'
  4. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    Define some variables to hold controlling values and use them instead of hardcoding: 'a', 'z', '0', '9' etc

    You could determine ascending/descending by looking at the first two char
  5. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    Not very reliable for Strings more than 2 char long. I don't see how testing the first and ending char of the String wold tell you what was in between the first and last char.

    How are you going...
  6. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    When you look at the first char what is the first test you need to make?

    Some thoughts:
    To detect if ascending see if next is +1 in value
    to detect descending see if next is -1 in value
    Special...
  7. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    start simple: get the char before the current char and test it, then get the char after the current char and test it. Move to next char.
    Don't try to do it all at once.

    --- Update ---

    Make a...
  8. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    I assume the input is in a String. Use the charAt() method to get the char values out of the String.
    Use a loop and if statements inside the loop to do the tests.

    --- Update ---

    char values in...
  9. Re: Need to find out if a String has consecutive letters or digits with LOOPING ('89012' or 'bazyx')

    Are these the rules: if looking at 'a' then 'z' and 'b' are consecutive. For 'd', 'c' and 'e'. For '0', '9' and '1'
Results 1 to 9 of 9