User Name
Password

Go Back   Planetarion Forums > Non Planetarion Discussions > General Discussions
Register FAQ Members List Calendar Arcade Today's Posts

Reply
Thread Tools Display Modes
Unread 16 May 2003, 13:28   #1
poshphil
Little Bitch
 
Join Date: Jun 2001
Location: Location Location!
Posts: 771
poshphil is an unknown quantity at this point
Does anyone fancy

writing me two QBasic programs for me?

I need one to work out and print all prime numbers under 1000.

And I need one that uses the Taylor series expansion to calculate exp(x)

You have 10 minutes to do it in btw.
__________________
Well I'd love to stay and talk, but you're a total bitch.
poshphil is offline   Reply With Quote
Unread 16 May 2003, 13:30   #2
sayonara
Shai Halud
 
sayonara's Avatar
 
Join Date: Aug 2001
Location: Sunny Leeds \o/
Posts: 2,127
sayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nice
I have the primes one already done.

Shame it's at home though - I'll rustle up another version now.

Someone else can do the one that actually needs effort.
__________________
meow
sayonara is offline   Reply With Quote
Unread 16 May 2003, 13:30   #3
Freakozoid
Anon.
 
Join Date: Sep 2000
Location: not in Milton Keynes
Posts: 491
Freakozoid is an unknown quantity at this point
ok.

wait ten minutes.
Freakozoid is offline   Reply With Quote
Unread 16 May 2003, 13:30   #4
poshphil
Little Bitch
 
Join Date: Jun 2001
Location: Location Location!
Posts: 771
poshphil is an unknown quantity at this point
Quote:
Originally posted by sayonara
I have the primes one already done.

Shame it's at home though - I'll rustle up another version now.

Someone else can do the one that actually needs effort.
Yay!

I'll need the source code though
__________________
Well I'd love to stay and talk, but you're a total bitch.
poshphil is offline   Reply With Quote
Unread 16 May 2003, 13:35   #5
MrL_JaKiri
The Twilight of the Gods
 
MrL_JaKiri's Avatar
 
Join Date: Jan 2001
Posts: 23,481
MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
The taylor expansion's easy.

10 INPUT X
20 LET Q = 1
30 LET T = 0
40 LET E = 0
50 LET P = 1 TO 1000
60 LET T = (X^P)/Q
70 LET E = E + T
80 LET Q = Q*(P+1)
90 NEXT P
100 PRINT E

does it to 1001 iterations

(ofc that's in BBC Basic, don't use QBasic personally)
MrL_JaKiri is offline   Reply With Quote
Unread 16 May 2003, 13:37   #6
Nodrog
Registered User
 
Join Date: Jun 2000
Posts: 8,476
Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Nodrog has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
10 PRINT "JIGGLYPUFF"
20 GOTO 10
Nodrog is offline   Reply With Quote
Unread 16 May 2003, 13:41   #7
[GAP]Obiwan
Registered User
 
Join Date: Aug 2002
Location: Bromley
Posts: 806
[GAP]Obiwan is an unknown quantity at this point
<usual_reply>
DO YOUR OWN ****ING HOMEWORK
</usual_reply>
__________________
Proud to be a pr0nstar and [TiT]
Proud to have been:
[_DoG_]HC
[ICE]DC
[Deus]
[Tok'ra]
[Ostraka]
www.tit.aresexy.com
[GAP]Obiwan is offline   Reply With Quote
Unread 16 May 2003, 13:43   #8
Evil Skragg
And you expected Kittens?
 
Evil Skragg's Avatar
 
Join Date: Nov 2001
Location: Purgatory, Upper Hell, Manchester.
Posts: 478
Evil Skragg will become famous soon enoughEvil Skragg will become famous soon enough
10 PRINT NODROG HAS CAUGHT "THE GHEY"
20 RUNPROG c:\Docs\mockinglaughter.wav
30 GOTO 10
RUN
__________________
If music be the food of love, then industrial techno be the food of BDSM.
Evil Skragg is offline   Reply With Quote
Unread 16 May 2003, 13:44   #9
poshphil
Little Bitch
 
Join Date: Jun 2001
Location: Location Location!
Posts: 771
poshphil is an unknown quantity at this point
It's not homework, its stuff we're doing in a 3hr practical for physics today, I've already done 3 weeks of it and bored as **** with it, plus its friday afternoon, and the quicker I get it done the quicker i can go home.

Not only this, but the people who are doing the class have no clue. And the keyboards there are crap.
__________________
Well I'd love to stay and talk, but you're a total bitch.
poshphil is offline   Reply With Quote
Unread 16 May 2003, 13:45   #10
[GAP]Obiwan
Registered User
 
Join Date: Aug 2002
Location: Bromley
Posts: 806
[GAP]Obiwan is an unknown quantity at this point
Quote:
Originally posted by poshphil
It's not homework, its stuff we're doing in a 3hr practical for physics today, I've already done 3 weeks of it and bored as **** with it, plus its friday afternoon, and the quicker I get it done the quicker i can go home.

Not only this, but the people who are doing the class have no clue. And the keyboards there are crap.
i bet you even moan when having sex!
__________________
Proud to be a pr0nstar and [TiT]
Proud to have been:
[_DoG_]HC
[ICE]DC
[Deus]
[Tok'ra]
[Ostraka]
www.tit.aresexy.com
[GAP]Obiwan is offline   Reply With Quote
Unread 16 May 2003, 14:10   #11
sayonara
Shai Halud
 
sayonara's Avatar
 
Join Date: Aug 2001
Location: Sunny Leeds \o/
Posts: 2,127
sayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nice
Code:
10 INPUT X
20 LET Q = 1
30 LET T = 0
40 LET E = 0
50 FOR p = 1 TO 1000
60      LET T = (X ^ p) / Q
70      LET E = E + T
80      LET Q = Q * (p + 1)
90
100 PRINT E
110 NEXT p
qBasic version

It overflows at the moment - I didn't check the maths, just changed it to qB form. Every second I spend doing this increases the risk that someone will discover I have done all my work for the day

[edit - the primes one is giving me hassle 'cos Ican't remember how I did it last time. Apparently qBasic does not get the idea of "if x/n <> int(x/n) then..."]

Last edited by sayonara; 16 May 2003 at 14:26.
sayonara is offline   Reply With Quote
Unread 16 May 2003, 15:07   #12
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by sayonara
[edit - the primes one is giving me hassle 'cos Ican't remember how I did it last time. Apparently qBasic does not get the idea of "if x/n <> int(x/n) then..."]
Use the mod operator, it's % in most languages.

x % n is equivalent to x/n <> int(x/n) I think. Though it could be n % x, can't remember.
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 16 May 2003, 15:26   #13
sayonara
Shai Halud
 
sayonara's Avatar
 
Join Date: Aug 2001
Location: Sunny Leeds \o/
Posts: 2,127
sayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nice
x MOD n in qBasic.

Which returns an integer - huzzah!
__________________
meow
sayonara is offline   Reply With Quote
Unread 16 May 2003, 15:27   #14
pablissimo
Henry Kelly
 
pablissimo's Avatar
 
Join Date: Apr 2000
Posts: 7,374
pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.pablissimo has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Hmm, really has been a while since I've done 'all that jazz'.
__________________
You're now playing ketchup
pablissimo is offline   Reply With Quote
Unread 16 May 2003, 16:03   #15
poshphil
Little Bitch
 
Join Date: Jun 2001
Location: Location Location!
Posts: 771
poshphil is an unknown quantity at this point
yay thanks for the help, we managed to copy off the lecturer guy though
__________________
Well I'd love to stay and talk, but you're a total bitch.
poshphil is offline   Reply With Quote
Unread 16 May 2003, 16:05   #16
MrL_JaKiri
The Twilight of the Gods
 
MrL_JaKiri's Avatar
 
Join Date: Jan 2001
Posts: 23,481
MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Post his version of the e^x one, I want to see if it's superior.
MrL_JaKiri is offline   Reply With Quote
Unread 16 May 2003, 16:11   #17
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Re: Does anyone fancy

Quote:
Originally posted by poshphil

I need one to work out and print all prime numbers under 1000.
PRINT "2 3 5 7 11 13 17 19 23 29 31 37 41 43 47"
PRINT "53 59 61 67 71 73 79 83 89 97 101 103 107 109 113"
PRINT "127 131 137 139 149 151 157 163 167 173 179 181 191 193 197"
PRINT "199 211 223 227 229 233 239 241 251 257 263 269 271 277 281"
PRINT "283 293 307 311 313 317 331 337 347 349 353 359 367 373 379"
PRINT "383 389 397 401 409 419 421 431 433 439 443 449 457 461 463"
PRINT "467 479 487 491 499 503 509 521 523 541 547 557 563 569 571"
PRINT "577 587 593 599 601 607 613 617 619 631 641 643 647 653 659"
PRINT "661 673 677 683 691 701 709 719 727 733 739 743 751 757 761"
PRINT "769 773 787 797 809 811 821 823 827 829 839 853 857 859 863"
PRINT "877 881 883 887 907 911 919 929 937 941 947 953 967 971 977"
PRINT "983 991 997"
queball is offline   Reply With Quote
Unread 16 May 2003, 16:21   #18
sayonara
Shai Halud
 
sayonara's Avatar
 
Join Date: Aug 2001
Location: Sunny Leeds \o/
Posts: 2,127
sayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nice
Re: Re: Does anyone fancy

Quote:
Originally posted by queball
sayonara is offline   Reply With Quote
Unread 16 May 2003, 17:27   #19
MrL_JaKiri
The Twilight of the Gods
 
MrL_JaKiri's Avatar
 
Join Date: Jan 2001
Posts: 23,481
MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by MrL_JaKiri
The taylor expansion's easy.

10 INPUT X
20 LET Q = 1
30 LET T = 0
40 LET E = 0
50 LET P = 1 TO 1000
60 LET T = (X^P)/Q
70 LET E = E + T
80 LET Q = Q*(P+1)
90 NEXT P
100 PRINT E

does it to 1001 iterations

(ofc that's in BBC Basic, don't use QBasic personally)
While I was walking in town, I realised that this is wrong

10 INPUT X
20 LET Q = 1
30 LET T = 0
40 LET E = 1
50 FOR P = 1 TO 1000
60 LET T = (X^P)/Q
70 LET E = E + T
80 LET Q = Q*(P+1)
90 NEXT P
100 PRINT E

Is the correct QBasic one.

(Let E = 1, not 0)
MrL_JaKiri is offline   Reply With Quote
Unread 16 May 2003, 18:07   #20
sayonara
Shai Halud
 
sayonara's Avatar
 
Join Date: Aug 2001
Location: Sunny Leeds \o/
Posts: 2,127
sayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nice
Quote:
Originally posted by MrL_JaKiri
While I was walking in town, I realised that this is wrong
(Let E = 1, not 0)
That would explain the overflow. Like I said, I didn't check the maths
__________________
meow
sayonara is offline   Reply With Quote
Unread 16 May 2003, 18:10   #21
Dante Hicks
Clerk
 
Join Date: Jun 2001
Posts: 13,940
Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.Dante Hicks has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Isn't "LET" redundant in QBasic?

a = 1 should be the same as LET a = 1, etc.
Dante Hicks is offline   Reply With Quote
Unread 16 May 2003, 18:11   #22
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Quote:
Originally posted by sayonara
That would explain the overflow. Like I said, I didn't check the maths
That's more likely to be the result of working out the factorial of 1000.
queball is offline   Reply With Quote
Unread 16 May 2003, 18:25   #23
MrL_JaKiri
The Twilight of the Gods
 
MrL_JaKiri's Avatar
 
Join Date: Jan 2001
Posts: 23,481
MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Quote:
Originally posted by queball
That's more likely to be the result of working out the factorial of 1000.
Well, I meant 100 when I originally posted it.

The explaning line was an edit, so I claim 'error carried through'

[edit]

Perhaps 50 would be better. Or 20.
MrL_JaKiri is offline   Reply With Quote
Unread 16 May 2003, 18:26   #24
queball
Ball
 
queball's Avatar
 
Join Date: Oct 2001
Posts: 4,410
queball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so littlequeball contributes so much and asks for so little
Quote:
Originally posted by MrL_JaKiri
Well, I meant 100 when I originally posted it.

The explaning line was an edit, so I claim 'error carried through'
9332621544394415268169923885626670049071596826438162146859296389521759999322991560894146397615651828 6253697920827223758251185210916864000000000000000000000000 is still pretty big
queball is offline   Reply With Quote
Unread 16 May 2003, 18:27   #25
MrL_JaKiri
The Twilight of the Gods
 
MrL_JaKiri's Avatar
 
Join Date: Jan 2001
Posts: 23,481
MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.MrL_JaKiri has ascended to a higher existance and no longer needs rep points to prove the size of his e-penis.
Yeah, but if you want e^x to loads of dp...

[edit]

And he didn't say it actually had to work, just that the program was valid.
MrL_JaKiri is offline   Reply With Quote
Unread 16 May 2003, 18:38   #26
Deathjam
Banned
 
Join Date: Oct 2000
Location: leeds
Posts: 592
Deathjam is an unknown quantity at this point
yea i now got qbasic on xp

Deathjam is offline   Reply With Quote
Unread 16 May 2003, 19:14   #27
poshphil
Little Bitch
 
Join Date: Jun 2001
Location: Location Location!
Posts: 771
poshphil is an unknown quantity at this point
Quote:
Originally posted by MrL_JaKiri
Post his version of the e^x one, I want to see if it's superior.
It's in the physics computer lab. Thats far too far away.

Sorry
__________________
Well I'd love to stay and talk, but you're a total bitch.
poshphil is offline   Reply With Quote
Unread 16 May 2003, 22:08   #28
sayonara
Shai Halud
 
sayonara's Avatar
 
Join Date: Aug 2001
Location: Sunny Leeds \o/
Posts: 2,127
sayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nicesayonara is just really nice
Quote:
Originally posted by queball
That's more likely to be the result of working out the factorial of 1000.
Like I said, I didn't work out the maths.
__________________
meow
sayonara is offline   Reply With Quote
Unread 16 May 2003, 23:00   #29
Tobe
Checkout Boy
 
Join Date: Jun 2002
Posts: 622
Tobe is an unknown quantity at this point
there should be ****ing buttons for this kind of stuff on they keyboard
__________________
David Dickinson says:
you're desperate in virtually every aspect of your life
Tobe is offline   Reply With Quote
Unread 17 May 2003, 00:14   #30
W
Gubbish
 
Join Date: Sep 2000
Location: #FoW
Posts: 2,323
W is a jewel in the roughW is a jewel in the roughW is a jewel in the rough
Code:
const limit=1000
dim b(limit)
a=2:t=1
do while a<=sqr(limit)
for d=0 to limit step a:b(d)=b(d)+1:next d
print a
do while b(a)>0:a=a+1:loop
loop
do while a<=limit
if b(a)=0 then print a
a=a+1
loop
Has the nice side effect of resulting in an array b() of how many prime factors every number lower than the limit has.
__________________
Gubble gubble gubble gubble
W is offline   Reply With Quote
Reply



Forum Jump


All times are GMT +1. The time now is 13:31.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018