473,325 Members | 2,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

team combinations

I'll try to explain as best I can what I am trying to do.
1v 2.00 1t 3.20 1h 1.90
2v 1.90 2t 3.20 2h 2.10
3v 1.80 3t 3.20 3h 1.90
4v 1.90 4t 3.20 4h 2.60
..........
..........

These are the games that are being played, usually there are between
10 - 14 games being played each day, so the amount of games vary. I
want to wheel these into 3 game parlays. Example:
1v 2v 3v = (2.00 * 1.90 * 1.80)
1v 2v 4v = (2.00 * 1.90 * 1.90)
1v 2v 3t = etc...
1v 2v 3h = etc...
1v 2v 4t
1v 2v 4h
1t 2v 3v
1t 2v 4v
etc...

The user would enter the games being played that day (10 - 14 games),
then the program will output every possible combination of 3 along
with the odds for that parlay. Can someone give me a hint on how to do
this. I'm still a beginner in C, so go easy on me!

Thanks
Steve
Nov 13 '05 #1
1 1656
Stephen wrote:

[snip]
The user would enter the games being played that day (10 - 14 games),
then the program will output every possible combination of 3 along
with the odds for that parlay. Can someone give me a hint on how to do
this. I'm still a beginner in C, so go easy on me!


Write a program that takes a set of values as input and prints the
specified combinations. The is called "choose" as in "given N elements,
choose a subset of K elements." You want all subsets such that each
subset is unique with respect to permutation (i.e., {1,2,3}, {1,3,2},
{3,1,2}, and {3,2,1} are all the same). This is fairly easy to do using
a bit-vector and a "rotor" to crank through all the possible
combinations (similar to an odometer in a car). There is code on the
web, and possibly in the clc archives.

After you have the subsets, you just combine the appropriate data which
you read in from your input file.

/david

--
Andre, a simple peasant, had only one thing on his mind as he crept
along the East wall: 'Andre, creep... Andre, creep... Andre, creep.'
-- unknown
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jim Hubbard | last post by:
Does anyone have any code for doing combinations in VB.net or visual basic ? I'd like to be able to get an array of combinations (not permutations) of words from a base group of words while...
36
by: rbt | last post by:
Say I have a list that has 3 letters in it: I want to print all the possible 4 digit combinations of those 3 letters: 4^3 = 64 aaaa
19
by: Thomas Cameron | last post by:
Hello all, I have an array of values which I would like to generate all possible combinations for. And example would be the values "a,b,c". This would produce the following: a ab abc ac
15
by: Thomas Cameron | last post by:
Hello all, I have an array of values which I would like to generate all possible combinations for. And example would be the values "a,b,c". This would produce the following: a ab abc ac b
3
by: Ryan | last post by:
I've been trying to find an algorithm that will output all of the possible combinations of items in an array. I know how to find the number of combinations for each set using nCr=n!/(r!(n-r)!) ...
5
by: Kamil Tezduyar | last post by:
I want to create a team to develop a web portal framework. The main purpose of this framework is reusing this in many projects. The major idea in my mind it, building it as much as flexible. We...
2
by: GrantMagic | last post by:
I have found that some strange combinations of characters in a URL can cause an error in my ASP.NET application. This is regarding URL Paramters For example: if i have the URL:...
5
by: Bails | last post by:
Hi all I have a theory for a lotto system and need help on how to code it. I want to create 1 massive database with EVERY combination of numbers possible in a given lotto system, then remove all...
2
by: zgfareed | last post by:
Can anyone suggest an algorithm or function to generate combinations/ permutations of a group of substrings stored in a vector. The substrings consists of 3 letters and the resulting string...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.