Results 1 to 6 of 6
  1. #1
    Srcee is offline Member
    Join Date
    Oct 2009
    Posts
    14
    Rep Power
    0

    Default I need a program, help please

    If someone can help me, I need a program in Java that will do the following:

    find a solution for a numerical riddle. A numerical riddle is made of letters and signs for arithmetic operations (+,- and =), for example B+AB=BA
    Different letters are for different digits. Same letters are for same digits. The solution of the riddle is making the letters into digits that will give a correct equation. For example, for the riddle AB+B=BA, the solution could be 89+9=98
    The riddles are placed in a file, where every line of the file is one riddle.
    The output should be every possible solution for every of the riddles of the file.
    If the first digit of the statement is 0, the solution shouldn't be printed. For example, AB+B=C, one solution is 01+1=2, but it shouldn't be in the output.

    If someone can help me, write me a private message please, I would prefer if you do not write in the thread.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    I'm sorry but that is not how this forum works. It is for sharing questions and solutions with all. As it is all you've done is post your assignment. If you have any specific questions, please post them as most all here would be more than happy to help you out.

    Much luck.

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Srcee View Post
    If someone can help me, write me a private message please, I would prefer if you do not write in the thread.
    But why post here then? imho, if you post here you should read here. It's a nice little puzzle, why withhold others from reading nice little solutions?

    kind regards,

    Jos

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by JosAH View Post
    But why post here then? imho, if you post here you should read here. It's a nice little puzzle, why withhold others from reading nice little solutions?
    Jos
    Much better stated than in my post. Thanks!

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Fubarable View Post
    Much better stated than in my post. Thanks!
    You're welcome of course; why not make this riddle a little contest? I can generate combinations and permutations (thereof) so the rest of the riddle shouldn't be much of a problem: just let the Javascript engine do the hard work ;-)

    kind regards,

    Jos

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,344
    Blog Entries
    7
    Rep Power
    20

    Default

    For teasers: my implementation finds the following solutions for ABCDE/FG == HIJ:

    Java Code:
    58401/63==927
    26910/78==345
    17820/36==495
    17820/45==396
    16038/27==594
    16038/54==297
    15678/39==402
    19084/52==367
    32890/46==715
    kind regards,

    Jos ;-)

Similar Threads

  1. changing my program to array working program
    By Chewart in forum New To Java
    Replies: 39
    Last Post: 11-18-2009, 06:53 PM
  2. Execute A program from a Program!
    By Moncleared in forum Advanced Java
    Replies: 2
    Last Post: 02-22-2009, 04:17 PM
  3. Executing a program within a program
    By gibsonrocker800 in forum New To Java
    Replies: 5
    Last Post: 05-12-2008, 08:24 AM
  4. Replies: 0
    Last Post: 04-04-2008, 02:40 PM
  5. Replies: 0
    Last Post: 10-04-2007, 09:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •