Messages - bgd77 [ switch to compact view ]

Pages: prev1 ... 21 22 23 24 25 [26] 27 28 29 30 31 ... 38next
Thanks for the answer, mouser! Your brute force method seems very interesting, it really got me thinking at the fact that there are some other methods to solving a problem besides algorithms. And in some cases those methods are better. But is it nice to stay and think about how to create a algorithm that solves a problem and then seeing that the algorithm works well (or not - and you have to fix it :)) gives you a very nice feeling.

I will probably implement both methods, to see if we can measure any difference in speed.

I'm curious to see the list of features, could you post it, djsdjs? :)

I want to create a simple program in C/C++, as an exercise and for fun, that can say if an number entered by the user (a number between 0 and 250) can be a rugby score and to display all the possible combinations of points.

For those that do not know, in rugby you are awarded 5 points if you score a try, 2 points for a conversion (a conversion always follows a try) and 3 points for a goal kick (through a penalty kick or drop goal). So, for example, 5, 6, 7, 8 and 10 are valid scores, but 4 and 9 are not valid. Probably higher scores are all valid, so the most interesting part would be to display all possible combinations.

The algorithm I thought of using:
1) check if the score can be obtained only by tries or goal kicks (i.e. see if the number is divisible by 5 or 3).
    a) for 1 to n tries
          b) in each try, for 0 to n conversions
                  check how many goal kicks are necessary to obtain the score (if it is possible)

Do you think it is a good algorithm? Can it be done in any other way?

If I will manage to create this I will share the program + the source code, if anyone is interested, of course.  :)


Find And Run Robot / Re: Updater Not Working
« on: March 10, 2009, 10:30 AM »
uh, ok  :-[

Find And Run Robot / Re: Updater Not Working
« on: March 10, 2009, 09:33 AM »
Thanks for the explanation, mouser. You shouldn't have to update the version number just because we asked, the explanation is sufficient.  :)

Pages: prev1 ... 21 22 23 24 25 [26] 27 28 29 30 31 ... 38next
Go to full version