OK so far, now it gets tricky.
The functions in question are passed a character string of variable length
(x if you will) aqnd the function then makes a progress bar move up to the
length of the string (x)
e.g. the string enterered is "progress"
the display would look like...
P R O G R E S S
* * * * \ _ _ _ (drawn spaced out for
clarity)
with the characters following the sequece below, the characters to be
drawn are shown as underscores until they follow the certain number of
revolutions (if you can call it that) then when they have they are drawn as
a star and the program begins on the next location
The routine displys these characters in the following set pattern an unknown
number of times.
The character sequence is thus \, |, / , -, \, |, /, -, *. No commas
obviously. (this looks quite good in DOS honest)
Now for the complecation
It doesn't just do this sequecnce once for each letter, it is (must be)
based on some kind of squared variable. Based on the length of the inputted
string. and the first few times seem to be longer than the very last ones,
i.e. it dows the sequence less times towards the end.
At the end is a table of results of X Vs Y where x is the length of the
inputted string and Y is the number characters put to the screen counted by
a little variable within the program that increments everytime the character
(whichever) is outputted to the screen.
You would need to bear in mind that the very last character in the sequence
is only displayed on the last run through at each position, and the only
variables with which it can compute the number from is the input length and
the number of positions in the sequence.
What I really need is some kind of formula to tell me how many characters
will be put to the screen from the input length. My task is to make the
progress bar take a certain amount of time to complete by using a delay
function. But I need to know how many characters will be produced so I can
adjust my delay time to force the whole process to take the desired amount
of time. I hope that makes sense.
Ok so are there any budding mathmeticians who can help me out? I hope so
here comes the data I've gatehred so far
X 1 2 3 4 5 6 7 8
9 10 11 12
----------------------------------------------------------------------------
------------
Y 16 53 125 246 430 691 1043 1500 2076 2785
3641 4658
P.S. Bear in mind that these numbers were generated by the program and may
be suffering from integer concatenation and or rounding errors.
Have fun and if you get it right I'll mention you in the credits of my
program when it is published
Rob Shaw
(chuckle) 20 years ago that would be a pretty bad combination, if you wanted
to make a living programming.
> ... my GCSE's won't help me to solve ...
What's a GCSE?
> OK so far, now it gets tricky.
> ...
> here comes the data I've gatehred so far
>
> X 1 2 3 4 5 6 7 8
> 9 10 11 12
> ----------------------------------------------------------------------------
> ------------
> Y 16 53 125 246 430 691 1043 1500 2076 2785
> 3641 4658
I didn't understand much of your description, but from what I did
understand, it seemed like your character output count oughta be a
polynomial of X. So I did the standard trick where you take the differences
between values. Each row A, B, and C in the table below is the difference
of the values north and northeast of it. I added a column for X=0 that
maintains that relationship (because that helps in the next step).
X: | 0| 1| 2| 3| 4| 5| 6| 7| 8| 9| 10| 11| 12|
Y: | 0|16|53|125|246|430|691|1043|1500|2076|2785|3641|4658|
A: |16|37|72|121|184|261|352| 457| 576| 709| 856|1017|
B: |21|35|49| 63| 77| 91|105| 119| 133| 147| 161|
C: |14|14|14| 14| 14| 14| 14| 14| 14| 14|
From this it's possible to bubble from bottom up and figure out the
functions. C(x) is obviously = 14. With the zero column avaliable, it's
easy to see that and B(x) = 21x + 14. A(x) is a little harder, but if you
know the identity that the sum of integers 1..n is n(n+1)/2, you can solve
it. Similarly, you could then solve for Y(x) if you know the idenity for
summing squares.
Instead of doing that, I find it's easier just to recognize that the result
will be a cubic (C is constant, B is a line, A is a quadratic, and Y is a
cubic), and solve for the coefficients.
The rest of the solution is left as an exercise for the interested reader.
> Have fun and if you get it right I'll mention you in the credits of my
> program when it is published
Not necessary in this case, but thanks for being aware of attribution. ;)
Bob H
--
-- Bob Harris =======================================================+
| This e-mail sponsored by... BroccoPop, the one and only carbonated |
| broccoli beverage. Get twice your daily antioxidants in every |
| bottle. Why not try BroccoPop with your lunch today? |
+====================================================================+
What I should have said was B(x) = 14x + 21
--
-- Bob Harris =======================================================+
| This e-mail sponsored by... NAVEL INTELLIGENCE, the health |
| monitoring computer that fits completely inside your navel. Buy |
| your Navel Intelligence today! |
+====================================================================+
Now that you've done the work of computing the difference table, you
can just read off the formula by using the leftmost column as the
coefficients in the basis {binom(X,k): k = 0, 1, ...}. Explicitly,
Y(X) = 0 binom(X,0) + 16 binom(X,1) + 21 binom(X,2) + 14 binom(X,3)
+ 0 binom(X,4) + 0 binom(X,5) + ...
= X (14 X^2 + 21 X + 61) / 6.
Rob Pratt
If you could clarify I would be very grateful
Thanks again
Rob Shaw
"Rob Pratt" <rob...@wnt.sas.com> wrote in message
news:TafWPGvVx8+r9v...@4ax.com...
Do you see where the 0, 16, 21, and 14 come from? If another row were
included in the difference table, it would look like this:
0 0 0 0 0 0 0 0 0
Of course, every row after that would also be all zeros. So the
leftmost column would be 0, 16, 21, 14, 0, 0, 0, 0, 0, ...
To get the formula for Y(X), multiply these numbers by the
corresponding binomial coefficients binom(X,k) and add them up.
See http://mathworld.wolfram.com/FiniteDifference.html, especially
formulas (7) and (8) and the example that follows these formulas.
If you don't what a binomial coefficient is, first see
http://mathworld.wolfram.com/BinomialCoefficient.html.
Rob Pratt
??? What's an a-level?
Bob H
English, Welsh and Northern Irish exams taken typically at age 18
(usually 2,3 or 4 subjects)
well you get the idea
Rob
"Henry" <se...@btinternet.com> wrote in message
news:3cd7091c...@news.btinternet.com...
Cheers
Rob Shaw
"Rob Shaw" <captain...@hotmail.com> wrote in message
news:FPeB8.10527$9W4.2...@news6-win.server.ntlworld.com...
Yes, it was unfair. The responses certainly seemed more math oriented
than programming. You might get better responses on a programming
group, but that's your problem. And no one should be accused of
spamming when making an honest mistake.
The people who deserve to get yelled at are those who flood the
newsgroups with crackpot proofs, pictures of Jesus in the Orion
nebula, the Face on Mars, etc. and those who don't read the FAQs.
x(61 + 21 x + 14 x^2)/6
where x=1 to 12
Pandelis Theodosiou
"Rob Shaw" <captain...@hotmail.com> wrote in message
news:l3TB8.9254$LI2.2...@news6-win.server.ntlworld.com...