Velocity Reviews > Script to divide

# Script to divide

Jeff
Guest
Posts: n/a

 12-06-2005
Ok gang. Here is what I have. I am using asp with Access DB on a microsoft
server.

I don't know if a premade script exists out there, but I couldn't find it.
I am looking for a script to use for my golf team. We have In-House Tourneys
that we play, and I want to show earnings won for the tourney, kind of like
the PGA golf does. What this script would have to do, is see how many
players finished the tourney, and divide the total (which would be
\$1,000,000 cyberbucks) per event. I would need it to give first the most,
second less, and so on. But the thing that I am unable to do, is determine
the breakdown with different amount of finishers.

If 4 finished all the time, the formula would be easy, but sometimes there
are as many as 20 that finish.

is kind of hard to describe what I need. http://www.velocityreviews.com/forums/(E-Mail Removed)--- (take out
the -- on both ends) is my email.
Thanks
Bam

Larry Bud
Guest
Posts: n/a

 12-06-2005
> the PGA golf does. What this script would have to do, is see how many
> players finished the tourney, and divide the total (which would be
> \$1,000,000 cyberbucks) per event. I would need it to give first the most,
> second less, and so on. But the thing that I am unable to do, is determine
> the breakdown with different amount of finishers.
>
> If 4 finished all the time, the formula would be easy, but sometimes there
> are as many as 20 that finish.

This really isn't an ASP question, but I'll give it a go.

It really depends on how you want to divide the pot up. Do you want to
give the winner half the pot, 1/3 of the pot, 1/4 of the pot??

You would always go in halves, no matter how many people are "in the
money".

Winner gets 1/2, 2nd place gets half of what's left (so really, 1/4),
3rd place gets have of what's left after that, (1/, etc. The last
guy gets whatever is remaining.

If two or more people tie, those places that they finished have the
money averaged out for those places.

Bob Barrows [MVP]
Guest
Posts: n/a

 12-06-2005
Jeff wrote:
> Ok gang. Here is what I have. I am using asp with Access DB on a
> microsoft server.
>
> I don't know if a premade script exists out there, but I couldn't
> find it. I am looking for a script to use for my golf team. We have
> In-House Tourneys that we play, and I want to show earnings won for
> the tourney, kind of like the PGA golf does. What this script would
> have to do, is see how many players finished the tourney, and divide
> the total (which would be \$1,000,000 cyberbucks) per event. I would
> need it to give first the most, second less, and so on. But the thing
> that I am unable to do, is determine the breakdown with different
> amount of finishers.
>
> If 4 finished all the time, the formula would be easy, but sometimes
> there are as many as 20 that finish.
>
> can. It is kind of hard to describe what I need.
> (E-Mail Removed)--- (take out the -- on both ends) is my email.
> Thanks
> Bam

We don't do email support. What you need to do is describe the structures of
the relevant tables (datatypes, fieldnames - only show the relevant fields),
show us some sample data in tabular format, and show us the results you wish
to retrieve from that sample data - also in tabular format.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Evertjan.
Guest
Posts: n/a

 12-06-2005
Jeff wrote on 06 dec 2005 in microsoft.public.inetserver.asp.general:

> Ok gang. Here is what I have. I am using asp with Access DB on a
> microsoft server.
>
> I don't know if a premade script exists out there, but I couldn't find
> it. I am looking for a script to use for my golf team. We have
> In-House Tourneys that we play, and I want to show earnings won for
> the tourney, kind of like the PGA golf does. What this script would
> have to do, is see how many players finished the tourney, and divide
> the total (which would be \$1,000,000 cyberbucks) per event. I would
> need it to give first the most, second less, and so on. But the thing
> that I am unable to do, is determine the breakdown with different
> amount of finishers.
>
> If 4 finished all the time, the formula would be easy, but sometimes
> there are as many as 20 that finish.
>
> can. It is kind of hard to describe what I need.
> (E-Mail Removed)--- (take out the -- on both ends) is my email.

For that amount of money,
you could easily spend 1% for a professional programmer?

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Larry Bud
Guest
Posts: n/a

 12-06-2005

Evertjan. wrote:
> Jeff wrote on 06 dec 2005 in microsoft.public.inetserver.asp.general:
>
> > Ok gang. Here is what I have. I am using asp with Access DB on a
> > microsoft server.
> >
> > I don't know if a premade script exists out there, but I couldn't find
> > it. I am looking for a script to use for my golf team. We have
> > In-House Tourneys that we play, and I want to show earnings won for
> > the tourney, kind of like the PGA golf does. What this script would
> > have to do, is see how many players finished the tourney, and divide
> > the total (which would be \$1,000,000 cyberbucks) per event. I would
> > need it to give first the most, second less, and so on. But the thing
> > that I am unable to do, is determine the breakdown with different
> > amount of finishers.
> >
> > If 4 finished all the time, the formula would be easy, but sometimes
> > there are as many as 20 that finish.
> >
> > can. It is kind of hard to describe what I need.
> > (E-Mail Removed)--- (take out the -- on both ends) is my email.

>
> For that amount of money,
> you could easily spend 1% for a professional programmer?

They're "cyberbucks", not greenbacks!

Larry Bud
Guest
Posts: n/a

 12-06-2005

Jeff wrote:
> Ok gang. Here is what I have. I am using asp with Access DB on a microsoft
> server.
>
> I don't know if a premade script exists out there, but I couldn't find it.
> I am looking for a script to use for my golf team. We have In-House Tourneys
> that we play, and I want to show earnings won for the tourney, kind of like
> the PGA golf does. What this script would have to do, is see how many
> players finished the tourney, and divide the total (which would be
> \$1,000,000 cyberbucks) per event.

Here's some code I whipped up that you can adapt for database use.

Note the line:
place_pot=int(ra*2/3)
You can change the ratio to suit your needs, but 2/3 seems to be pretty
fair.

<%
num_players=request.form("num_players")
total_pot=request.form("total_pot")
%> <html>

<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<title>Purse</title>
<meta name="Microsoft Theme" content="tacnet-blue 110, default">

<body>

<%if num_players="" then%>
<form method="POST" action="--WEBBOT-SELF--" name="theform1">
<p># of players: <input type="text" name="num_players" size="20"></p>
<p>Total pot: <input type="text" name="total_pot" size="20">
<input type="submit" value="Submit" name="B1"></p>
</form>
<%else%>
<tr>
<td><b>Place</b></td>
<td><b>Player</b></td>
<td><b>Amount</b></td>
</tr>
<%
ra=total_pot
for i=1 to num_players-1
place_pot=int(ra*2/3)
ra=ra-place_pot
%>
<tr>
<td><%=i%></td>
<td><%=chr(i+64)%></td>
<td align="right"><%=place_pot%></td>
</tr>
<%next%>
<tr>
<td><%=i%></td>
<td><%=chr(i+64)%></td>
<td align="right"><%=ra%></td>
</tr>
</table>
<%end if%>

</body>

</html>

Evertjan.
Guest
Posts: n/a

 12-06-2005
Larry Bud wrote on 06 dec 2005 in microsoft.public.inetserver.asp.general:

> They're "cyberbucks", not greenbacks!

Euros will do. ;-}

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Jeff
Guest
Posts: n/a

 12-06-2005
Sorry Bob, I just didn't want to clutter up things here.

"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:eri5fGn%(E-Mail Removed)...
> Jeff wrote:
>> Ok gang. Here is what I have. I am using asp with Access DB on a
>> microsoft server.
>>
>> I don't know if a premade script exists out there, but I couldn't
>> find it. I am looking for a script to use for my golf team. We have
>> In-House Tourneys that we play, and I want to show earnings won for
>> the tourney, kind of like the PGA golf does. What this script would
>> have to do, is see how many players finished the tourney, and divide
>> the total (which would be \$1,000,000 cyberbucks) per event. I would
>> need it to give first the most, second less, and so on. But the thing
>> that I am unable to do, is determine the breakdown with different
>> amount of finishers.
>>
>> If 4 finished all the time, the formula would be easy, but sometimes
>> there are as many as 20 that finish.
>>
>> can. It is kind of hard to describe what I need.
>> (E-Mail Removed)--- (take out the -- on both ends) is my email.
>> Thanks
>> Bam

> We don't do email support. What you need to do is describe the structures
> of
> the relevant tables (datatypes, fieldnames - only show the relevant
> fields),
> show us some sample data in tabular format, and show us the results you
> wish
> to retrieve from that sample data - also in tabular format.
>
> Bob Barrows
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
>
>

Jeff
Guest
Posts: n/a

 12-06-2005
LOL. Surely I wouldn't actually PAY that amount. And yes, I will stop
calling you shirley.

Anyway, thanks Larry, this gives me a great starting point to go by.
Bam

"Larry Bud" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>
> Jeff wrote:
>> Ok gang. Here is what I have. I am using asp with Access DB on a
>> microsoft
>> server.
>>
>> I don't know if a premade script exists out there, but I couldn't find
>> it.
>> I am looking for a script to use for my golf team. We have In-House
>> Tourneys
>> that we play, and I want to show earnings won for the tourney, kind of
>> like
>> the PGA golf does. What this script would have to do, is see how many
>> players finished the tourney, and divide the total (which would be
>> \$1,000,000 cyberbucks) per event.

>
> Here's some code I whipped up that you can adapt for database use.
>
> Note the line:
> place_pot=int(ra*2/3)
> You can change the ratio to suit your needs, but 2/3 seems to be pretty
> fair.
>
> <%
> num_players=request.form("num_players")
> total_pot=request.form("total_pot")
> %> <html>
>
> <meta http-equiv="Content-Language" content="en-us">
> <meta http-equiv="Content-Type" content="text/html;
> charset=windows-1252">
> <title>Purse</title>
> <meta name="Microsoft Theme" content="tacnet-blue 110, default">
>
> <body>
>
> <%if num_players="" then%>
> <form method="POST" action="--WEBBOT-SELF--" name="theform1">
> <p># of players: <input type="text" name="num_players" size="20"></p>
> <p>Total pot: <input type="text" name="total_pot" size="20">
> <input type="submit" value="Submit" name="B1"></p>
> </form>
> <%else%>
> <tr>
> <td><b>Place</b></td>
> <td><b>Player</b></td>
> <td><b>Amount</b></td>
> </tr>
> <%
> ra=total_pot
> for i=1 to num_players-1
> place_pot=int(ra*2/3)
> ra=ra-place_pot
> %>
> <tr>
> <td><%=i%></td>
> <td><%=chr(i+64)%></td>
> <td align="right"><%=place_pot%></td>
> </tr>
> <%next%>
> <tr>
> <td><%=i%></td>
> <td><%=chr(i+64)%></td>
> <td align="right"><%=ra%></td>
> </tr>
> </table>
> <%end if%>
>
> </body>
>
> </html>
>

Jeff
Guest
Posts: n/a

 12-06-2005
Ok. I am using 2/5, which is 40%. However, the last place person keeps
coming up with more than next to last. Test it here:
http://www.gig-golf.com/purse.asp
Is weird
I guess maybe it is giving the remaining amount to the guy in last place?

"Larry Bud" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
>
> Jeff wrote:
>> Ok gang. Here is what I have. I am using asp with Access DB on a
>> microsoft
>> server.
>>
>> I don't know if a premade script exists out there, but I couldn't find
>> it.
>> I am looking for a script to use for my golf team. We have In-House
>> Tourneys
>> that we play, and I want to show earnings won for the tourney, kind of
>> like
>> the PGA golf does. What this script would have to do, is see how many
>> players finished the tourney, and divide the total (which would be
>> \$1,000,000 cyberbucks) per event.

>
> Here's some code I whipped up that you can adapt for database use.
>
> Note the line:
> place_pot=int(ra*2/3)
> You can change the ratio to suit your needs, but 2/3 seems to be pretty
> fair.
>
> <%
> num_players=request.form("num_players")
> total_pot=request.form("total_pot")
> %> <html>
>
> <meta http-equiv="Content-Language" content="en-us">
> <meta http-equiv="Content-Type" content="text/html;
> charset=windows-1252">
> <title>Purse</title>
> <meta name="Microsoft Theme" content="tacnet-blue 110, default">
>
> <body>
>
> <%if num_players="" then%>
> <form method="POST" action="--WEBBOT-SELF--" name="theform1">
> <p># of players: <input type="text" name="num_players" size="20"></p>
> <p>Total pot: <input type="text" name="total_pot" size="20">
> <input type="submit" value="Submit" name="B1"></p>
> </form>
> <%else%>
> <tr>
> <td><b>Place</b></td>
> <td><b>Player</b></td>
> <td><b>Amount</b></td>
> </tr>
> <%
> ra=total_pot
> for i=1 to num_players-1
> place_pot=int(ra*2/3)
> ra=ra-place_pot
> %>
> <tr>
> <td><%=i%></td>
> <td><%=chr(i+64)%></td>
> <td align="right"><%=place_pot%></td>
> </tr>
> <%next%>
> <tr>
> <td><%=i%></td>
> <td><%=chr(i+64)%></td>
> <td align="right"><%=ra%></td>
> </tr>
> </table>
> <%end if%>
>
> </body>
>
> </html>
>