Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: ALGORITHM TO USE TO FIND A SOLUTION TO A POINT GAME

  1. #1
    Junior Member Tjones787's Avatar
    Join Date
    Jan 2014
    Location
    Lagos, Nigeira
    Posts
    16
    My Mood
    Asleep
    Thanks
    4
    Thanked 1 Time in 1 Post

    Post ALGORITHM TO USE TO FIND A SOLUTION TO A POINT GAME

    Hi im joseph,

    im new to this forum.....

    working on assignment called a Card Game...the program select four card images out of 52 card images ... find the solution for the possible algebraic expression out of the four cards selected and the result of the expression must equals 24.... the number of the cards are from 1 - 13..
    Tjones787


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: ALGORITHM TO USE TO FIND A SOLUTION TO A POINT GAME

    Welcome, Joseph. What help do you need? Show what you've tried and ask specific questions about the code, post any errors you want help with, etc. It's unclear how you expect to go from 'images' to values to determine the expression and the significance of 24 in this whole business. It might be helpful if you can post the assignment or instructions directly, in English anyway.

    While you're pondering that, also read this FAQ for instructions on how to post code correctly and other useful tips for newcomers.

  3. #3
    Junior Member Tjones787's Avatar
    Join Date
    Jan 2014
    Location
    Lagos, Nigeira
    Posts
    16
    My Mood
    Asleep
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Re: ALGORITHM TO USE TO FIND A SOLUTION TO A POINT GAME

    The problem is to write program that accept 4 number from user, and the number must be between 1 to 13 and the program find a solution or algebraic expression from the numbers supplied by the user and the result of the expression must be 24 if not print no possible solution to the user... Already programmed the GUI.
    But the logic to get the expression or solution still trying to get. So I thought if I could get some help with an algorithm.
    Tjones787

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: ALGORITHM TO USE TO FIND A SOLUTION TO A POINT GAME

    Ah, so an algorithm to solve for a, b, c, and d in the equation:

    a * w + b * x + c * y + d * z = 24

    where w, x, y, z are supplied by the user and take the values 1 to 13, inclusive, right? I assume that a, b, c, and d cannot be zero. Is that right? Are you to find all possible solutions for each w, x, y, and z, or just A solution?

    The brute force method would be to try every combination until some criteria was met that indicated there was no possible solution.

    Does that give you any ideas?

  5. #5
    Junior Member Tjones787's Avatar
    Join Date
    Jan 2014
    Location
    Lagos, Nigeira
    Posts
    16
    My Mood
    Asleep
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Re: ALGORITHM TO USE TO FIND A SOLUTION TO A POINT GAME

    Yeah.. Mr greg you get what I was trying to insinuate . Just that the user input would be within the range of 1 - 13 and no other variables inclusive.
    And I'm to find all possible solutions w, y, x, z.
    Thanks for the idea. Have heard of brute force approach.
    Will do the digging about brute force approach tonight.
    Thanks.
    Tjones787

Similar Threads

  1. [SOLVED] Can't find solution for error in my code..
    By adi2609 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: April 26th, 2013, 11:10 AM
  2. How would I create this solution algorithm using pseudocode? Im stuck..
    By meghere in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 14th, 2013, 01:52 AM
  3. How would I create this solution algorithm using pseudocode?
    By meghere in forum Algorithms & Recursion
    Replies: 1
    Last Post: February 13th, 2013, 10:43 PM
  4. Better solution for moving my rectangle? (simple game)
    By JohnZ in forum Java Theory & Questions
    Replies: 5
    Last Post: May 24th, 2012, 09:54 AM
  5. Find prime nums from 1-100 algorithm
    By The-EyE in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 5th, 2012, 11:39 PM