473,811 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Script to divide

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.

Does this make sense? If someone wants to email me about this they can. It
is kind of hard to describe what I need. --****@gig-golf.com--- (take out
the -- on both ends) is my email.
Thanks
Bam
Dec 6 '05 #1
17 4214
> 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/8), 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.

Dec 6 '05 #2
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.

Does this make sense? If someone wants to email me about this they
can. It is kind of hard to describe what I need.
--****@gig-golf.com--- (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.
Dec 6 '05 #3
Jeff wrote on 06 dec 2005 in microsoft.publi c.inetserver.as p.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.

Does this make sense? If someone wants to email me about this they
can. It is kind of hard to describe what I need.
--****@gig-golf.com--- (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)

Dec 6 '05 #4

Evertjan. wrote:
Jeff wrote on 06 dec 2005 in microsoft.publi c.inetserver.as p.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.

Does this make sense? If someone wants to email me about this they
can. It is kind of hard to describe what I need.
--****@gig-golf.com--- (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!

Dec 6 '05 #5

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(r a*2/3)
You can change the ratio to suit your needs, but 2/3 seems to be pretty
fair.

<%
num_players=req uest.form("num_ players")
total_pot=reque st.form("total_ pot")
%> <html>

<head>
<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">
</head>

<body>

<%if num_players="" then%>
<form method="POST" action="--WEBBOT-SELF--" name="theform1" >
<p># of players: <input type="text" name="num_playe rs" size="20"></p>
<p>Total pot: <input type="text" name="total_pot " size="20">
<input type="submit" value="Submit" name="B1"></p>
</form>
<%else%>
<table cellspacing="0" cellpadding="3" >
<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(r a*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>

Dec 6 '05 #6
Larry Bud wrote on 06 dec 2005 in microsoft.publi c.inetserver.as p.general:
They're "cyberbucks ", not greenbacks!


Euros will do. ;-}

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

Dec 6 '05 #7
Sorry Bob, I just didn't want to clutter up things here.
"Bob Barrows [MVP]" <re******@NOyah oo.SPAMcom> wrote in message
news:er******** ********@TK2MSF TNGP12.phx.gbl. ..
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.

Does this make sense? If someone wants to email me about this they
can. It is kind of hard to describe what I need.
--****@gig-golf.com--- (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.

Dec 6 '05 #8
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" <la**********@y ahoo.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.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(r a*2/3)
You can change the ratio to suit your needs, but 2/3 seems to be pretty
fair.

<%
num_players=req uest.form("num_ players")
total_pot=reque st.form("total_ pot")
%> <html>

<head>
<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">
</head>

<body>

<%if num_players="" then%>
<form method="POST" action="--WEBBOT-SELF--" name="theform1" >
<p># of players: <input type="text" name="num_playe rs" size="20"></p>
<p>Total pot: <input type="text" name="total_pot " size="20">
<input type="submit" value="Submit" name="B1"></p>
</form>
<%else%>
<table cellspacing="0" cellpadding="3" >
<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(r a*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>

Dec 6 '05 #9
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" <la**********@y ahoo.com> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.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(r a*2/3)
You can change the ratio to suit your needs, but 2/3 seems to be pretty
fair.

<%
num_players=req uest.form("num_ players")
total_pot=reque st.form("total_ pot")
%> <html>

<head>
<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">
</head>

<body>

<%if num_players="" then%>
<form method="POST" action="--WEBBOT-SELF--" name="theform1" >
<p># of players: <input type="text" name="num_playe rs" size="20"></p>
<p>Total pot: <input type="text" name="total_pot " size="20">
<input type="submit" value="Submit" name="B1"></p>
</form>
<%else%>
<table cellspacing="0" cellpadding="3" >
<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(r a*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>

Dec 6 '05 #10

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

Similar topics

4
5971
by: Jack Smith | last post by:
Hello, I am working on the following problem. I need a divide and conquer algorithm to solve the following problem. Any help is appreciated. I have a set of coordinates (x,y) and each coordinate has an ID and load factor. The load factor is a count of all the coordinates that are northeast of a point (x,y) (i.e. all points (x_i,y_i) such that x_i>=x and y_i>=y). Does anyone know a divide and conquer algorithm i can use to compute...
1
1923
by: Christopher Benson-Manica | last post by:
We have a fairly large (1500 line) .js file that contains script that most of our pages use. My personal opinion is that this is not easy to maintain, but others are concerned that with the script placed in separate smaller files the web server will have to process several other requests for script files, which will impact the performance of the server. Is that concern well placed? If so, is there some other way to break up a large...
1
1394
by: steven.harms | last post by:
Hi gurus, 1. foo.html has a script tag to reference'foo.js' 2. foo.js wants to use the handy datadumper.js routines 3. How does foo.js become aware of functions in the datadumper.js namespace? Is this possible? I'm sure it must be? Assuming it is....
40
3671
by: Spiros Bousbouras | last post by:
Do you have an example of an implementation where sizeof(short int) does not divide sizeof(int) or sizeof(int) does not divide sizeof(long int) or sizeof(long int) does not divide sizeof(long long int) ? Same question for the corresponding unsigned types.
6
1341
by: bleen | last post by:
can someone point me in the right direction here.. I have a script (essentially a giant for loop) that takes about 20 mins to run on my server. I want "split" this process onto a second server by doing something like this: system("/srv1/path/to/php /path/to/script.php ".$arg1." ".$arg2." / dev/null &"); system("/srv2/path/to/php srv1/path/to/script.php ".$arg1." ".$arg2."
5
1721
by: gray_slp | last post by:
I am designing a web survey using surveymonkey.com and discovered I could use javascript to modify their standard question formats much the same as can be done in myspace. I used this feature to insert a weight converter into my survey. Unfortunately this script works fine in firefox v.2 but does not cooperate with the surveymonkey software when used with internet explorer v.6. Can someone explain to me in simple terms why the script...
1
2345
by: gray_slp | last post by:
I am designing a web survey using surveymonkey.com and discovered I could use javascript to modify their standard question formats much the same as can be done in myspace. I used this feature to insert a weight converter I found into my survey. Unfortunately this script works fine in firefox v.2 but does not cooperate with the surveymonkey software when used with internet explorer v.6. In IE, the script makes it so that I am unable to...
2
2192
by: peteinglastonbury | last post by:
I'd be most grateful if someone would help me. I hope I'm in the right forum (apologies if not) - I'm not sure whether my problem is CGI or Javascript related. I found a script called BatmoAudiopop.js which opens a pop-up browser window with an audio player when a link is clicked. Basically, it sets the right mime-type depending on the operating system and audio file type, then opens a window with the audio file (passed as a parameter) in...
0
9728
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10648
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4339
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.