Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. Thread: Vampire Numbers

    by Norm
    Replies
    20
    Views
    6,370

    Re: Vampire Numbers

    Here's the top of the list from Google:
    Vampire Numbers
  2. Thread: Vampire Numbers

    by Norm
    Replies
    20
    Views
    6,370

    Re: Vampire Numbers

    How is the search for the algorithm going? Not much you can do until you get that.
  3. Thread: Vampire Numbers

    by Norm
    Replies
    20
    Views
    6,370

    Re: Vampire Numbers

    Can you explain why you thought the output of the code should be:
    1
    2
    6

    That would require three calls to println.
  4. Thread: Vampire Numbers

    by Norm
    Replies
    20
    Views
    6,370

    Re: Vampire Numbers

    Can you explain the steps you are doing?
    Is the number input as a String: "126" or as an int 126?
    Then what do you do with it?
  5. Thread: Vampire Numbers

    by Norm
    Replies
    20
    Views
    6,370

    Re: Vampire Numbers

    That formula does make sense. I'd expect something like: a*1000 + b*100 + c*10 + d

    The value of the char '0' is not the int 0. You can get the int value for a numeric char by subtracting '0' from...
  6. Thread: Vampire Numbers

    by Norm
    Replies
    20
    Views
    6,370

    Re: Vampire Numbers

    You can only use methods with objects like a String. int is a primitive.

    If you found code that works with 4 digits, can you figure out what its algorithm is and use that for any number of digits?
  7. Thread: Vampire Numbers

    by Norm
    Replies
    20
    Views
    6,370

    Re: Vampire Numbers

    Look at generating all possible combinations of the digits in the given number. Then split each number into all the possible two number groups.
  8. Thread: Vampire Numbers

    by Norm
    Replies
    20
    Views
    6,370

    Re: Vampire Numbers

    It looks like the major part of the assignment is getting the algorithm. Given that the coding shouldn't be too difficult. What algorithm have you come up with?
Results 1 to 8 of 8