/ Forside / Teknologi / Udvikling / Delphi/Pascal / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
Delphi/Pascal
#NavnPoint
oldwiking 603
jrossing 525
rpje 520
EXTERMINA.. 500
gandalf 460
gubi 270
DJ_Puden 250
PARKENSS 230
technet 210
10  jdjespers.. 200
Help needed !!! (pascal program)
Fra : Maarten


Dato : 18-04-01 22:49

Can anyone help me with this program i'm trying to make !?
The idea of the program is to simulatie the throwing of a die.
Can anyone help me?
Thanks !!

-------------------DUTCH-------------------
Kan iemand mij helpen met het maken van een programma !?
Het idee is om een programma te maken wat het gooien van een dobbelsteen
simuleerd.
Alvast bedankt !!
-------------------DUTCH-------------------



 
 
N. Johnson (19-04-2001)
Kommentar
Fra : N. Johnson


Dato : 19-04-01 00:45


"Maarten" <mvddonk@wish.nl> wrote in message
news:987631802.275373@news.l3.wish.net...
> Can anyone help me with this program i'm trying to make !?
> The idea of the program is to simulatie the throwing of a die.
> Can anyone help me?
> Thanks !!

for i:=1 to 12 do i
if (i=12) or (i=2) or (i=3) then you are full of crap
else
you may want want someone to do your work for you;

<G>
Although I'm simple-minded, your post is too simple to have a serious reply.








>
> -------------------DUTCH-------------------
> Kan iemand mij helpen met het maken van een programma !?
> Het idee is om een programma te maken wat het gooien van een dobbelsteen
> simuleerd.
> Alvast bedankt !!
> -------------------DUTCH-------------------
>
>



Jud McCranie (19-04-2001)
Kommentar
Fra : Jud McCranie


Dato : 19-04-01 02:52

"Maarten" <mvddonk@wish.nl> wrote:

>Can anyone help me with this program i'm trying to make !?
>The idea of the program is to simulatie the throwing of a die.
>Can anyone help me?

Do you want to show a graphic simulation of throwing a die, or
just generate numbers?

CFB Software (19-04-2001)
Kommentar
Fra : CFB Software


Dato : 19-04-01 05:58

Randomize; // Call once only to initialise
.....
.....
DieThrow := Random(5) + 1;

Each execution of this statement will assign a random number in the range 1
to 6 to DieThrow if that is what you are trying to do,

Chris Burrows
CFB Software
http://www.cfbsoftware.com.au

"Maarten" <mvddonk@wish.nl> wrote in message
news:987631802.275373@news.l3.wish.net...
> Can anyone help me with this program i'm trying to make !?
> The idea of the program is to simulatie the throwing of a die.
> Can anyone help me?
> Thanks !!
>
> -------------------DUTCH-------------------
> Kan iemand mij helpen met het maken van een programma !?
> Het idee is om een programma te maken wat het gooien van een dobbelsteen
> simuleerd.
> Alvast bedankt !!
> -------------------DUTCH-------------------
>
>



M.H. Avegaart (19-04-2001)
Kommentar
Fra : M.H. Avegaart


Dato : 19-04-01 08:39

Last time I checked dice had 6 sides (at least the most common ones), so the
code should be:

DieThrow := Random(6) + 1;


"CFB Software" <info@cfbsoftware.com.au> schreef in bericht
news:3ade7bdb@news.iprimus.com.au...
> Randomize; // Call once only to initialise
> ....
> ....
> DieThrow := Random(5) + 1;
>
> Each execution of this statement will assign a random number in the range
1
> to 6 to DieThrow if that is what you are trying to do,
>
> Chris Burrows
> CFB Software
> http://www.cfbsoftware.com.au
>
> "Maarten" <mvddonk@wish.nl> wrote in message
> news:987631802.275373@news.l3.wish.net...
> > Can anyone help me with this program i'm trying to make !?
> > The idea of the program is to simulatie the throwing of a die.
> > Can anyone help me?
> > Thanks !!
> >
> > -------------------DUTCH-------------------
> > Kan iemand mij helpen met het maken van een programma !?
> > Het idee is om een programma te maken wat het gooien van een dobbelsteen
> > simuleerd.
> > Alvast bedankt !!
> > -------------------DUTCH-------------------
> >
> >
>
>



James Roberts (19-04-2001)
Kommentar
Fra : James Roberts


Dato : 19-04-01 13:04

Wouldn't the results of Random(5) be 0 through 5? If so, then
Random(5)+1 would yield 1 through 6.

Bill Braun


"M.H. Avegaart" wrote:
>
> Last time I checked dice had 6 sides (at least the most common ones), so the
> code should be:
>
> DieThrow := Random(6) + 1;
>
> "CFB Software" <info@cfbsoftware.com.au> schreef in bericht
> news:3ade7bdb@news.iprimus.com.au...
> > Randomize; // Call once only to initialise
> > ....
> > ....
> > DieThrow := Random(5) + 1;
> >
> > Each execution of this statement will assign a random number in the range
> 1
> > to 6 to DieThrow if that is what you are trying to do,
> >
> > Chris Burrows
> > CFB Software
> > http://www.cfbsoftware.com.au
> >
> > "Maarten" <mvddonk@wish.nl> wrote in message
> > news:987631802.275373@news.l3.wish.net...
> > > Can anyone help me with this program i'm trying to make !?
> > > The idea of the program is to simulatie the throwing of a die.
> > > Can anyone help me?
> > > Thanks !!
> > >
> > > -------------------DUTCH-------------------
> > > Kan iemand mij helpen met het maken van een programma !?
> > > Het idee is om een programma te maken wat het gooien van een dobbelsteen
> > > simuleerd.
> > > Alvast bedankt !!
> > > -------------------DUTCH-------------------
> > >
> > >
> >
> >

Christian Iversen (19-04-2001)
Kommentar
Fra : Christian Iversen


Dato : 19-04-01 13:54

> Wouldn't the results of Random(5) be 0 through 5? If so, then
> Random(5)+1 would yield 1 through 6.
>

No!

Random(x) gives you x possibilities, starting from zero. This is always a
nice way to remember it.. =)

So, for 6 sides, use Random(6)+1, to start at 1.

M.V.H, Christian Iversen



David C. Ullrich (19-04-2001)
Kommentar
Fra : David C. Ullrich


Dato : 19-04-01 16:00

On Thu, 19 Apr 2001 08:03:53 -0400, James Roberts <me@privacy.net>
wrote:

>Wouldn't the results of Random(5) be 0 through 5?

Type the word "random" in the IDE. Put the cursor on
that word. Now hit the F1 key.

CFB Software (20-04-2001)
Kommentar
Fra : CFB Software


Dato : 20-04-01 01:27

Bill,

Thanks for your defence but I'm afraid M.H. Avegaart is correct. Random(n)
returns the result 0 .. n - 1. The problem wasn't quite as simple as some
seemed to think.

Chris Burrows
CFB Software
http://www.cfbsoftware.com.au

"James Roberts" <me@privacy.net> wrote in message
news:3ADED429.1C9CDC4A@privacy.net...
> Wouldn't the results of Random(5) be 0 through 5? If so, then
> Random(5)+1 would yield 1 through 6.
>
> Bill Braun
>
>
> "M.H. Avegaart" wrote:
> >
> > Last time I checked dice had 6 sides (at least the most common ones), so
the
> > code should be:
> >
> > DieThrow := Random(6) + 1;
> >
> > "CFB Software" <info@cfbsoftware.com.au> schreef in bericht
> > news:3ade7bdb@news.iprimus.com.au...
> > > Randomize; // Call once only to initialise
> > > ....
> > > ....
> > > DieThrow := Random(5) + 1;
> > >
> > > Each execution of this statement will assign a random number in the
range
> > 1
> > > to 6 to DieThrow if that is what you are trying to do,
> > >
> > > Chris Burrows
> > > CFB Software
> > > http://www.cfbsoftware.com.au
> > >
> > > "Maarten" <mvddonk@wish.nl> wrote in message
> > > news:987631802.275373@news.l3.wish.net...
> > > > Can anyone help me with this program i'm trying to make !?
> > > > The idea of the program is to simulatie the throwing of a die.
> > > > Can anyone help me?
> > > > Thanks !!
> > > >
> > > > -------------------DUTCH-------------------
> > > > Kan iemand mij helpen met het maken van een programma !?
> > > > Het idee is om een programma te maken wat het gooien van een
dobbelsteen
> > > > simuleerd.
> > > > Alvast bedankt !!
> > > > -------------------DUTCH-------------------
> > > >
> > > >
> > >
> > >



CFB Software (20-04-2001)
Kommentar
Fra : CFB Software


Dato : 20-04-01 01:10

Oops - thanks for pointing that out! Forgot to follow my own rule of
actually compiling the code and running it before publishing it - no matter
how simple it might seem.

Chris Burrows
CFB Software
http://www.cfbsoftware.com.au


"M.H. Avegaart" <avegaartNOSPAM@mccomm.nl> wrote in message
news:9bm4o3$qo5$1@porthos.nl.uu.net...
> Last time I checked dice had 6 sides (at least the most common ones), so
the
> code should be:
>
> DieThrow := Random(6) + 1;
>
>
> "CFB Software" <info@cfbsoftware.com.au> schreef in bericht
> news:3ade7bdb@news.iprimus.com.au...
> > Randomize; // Call once only to initialise
> > ....
> > ....
> > DieThrow := Random(5) + 1;
> >
> > Each execution of this statement will assign a random number in the
range
> 1
> > to 6 to DieThrow if that is what you are trying to do,
> >
> > Chris Burrows
> > CFB Software
> > http://www.cfbsoftware.com.au
> >
> > "Maarten" <mvddonk@wish.nl> wrote in message
> > news:987631802.275373@news.l3.wish.net...
> > > Can anyone help me with this program i'm trying to make !?
> > > The idea of the program is to simulatie the throwing of a die.
> > > Can anyone help me?
> > > Thanks !!
> > >
> > > -------------------DUTCH-------------------
> > > Kan iemand mij helpen met het maken van een programma !?
> > > Het idee is om een programma te maken wat het gooien van een
dobbelsteen
> > > simuleerd.
> > > Alvast bedankt !!
> > > -------------------DUTCH-------------------
> > >
> > >
> >
> >
>
>



Dr John Stockton (19-04-2001)
Kommentar
Fra : Dr John Stockton


Dato : 19-04-01 13:05

JRS: In article <3ade7bdb@news.iprimus.com.au>, seen in news:comp.lang.
pascal.delphi.misc, CFB Software <info@cfbsoftware.com.au> wrote at Thu,
19 Apr 2001 14:27:43 :-

>"Maarten" <mvddonk@wish.nl> wrote in message
>news:987631802.275373@news.l3.wish.net...
>> Can anyone help me with this program i'm trying to make !?
>> The idea of the program is to simulatie the throwing of a die.

>Randomize; // Call once only to initialise
>....
>....
>DieThrow := Random(5) + 1;
>
>Each execution of this statement will assign a random number in the range 1
>to 6 to DieThrow if that is what you are trying to do,

Quoting order corrected.

Never play dice with an Australian; theirs are evidently configured
never to show a six.

--
© John Stockton, Surrey, UK. jrs@merlyn.demon.co.uk Turnpike v4.00 MIME. ©
<URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ;
<URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.

CFB Software (20-04-2001)
Kommentar
Fra : CFB Software


Dato : 20-04-01 01:17

I'm an East-Ender actually which should explain everything - though have
since been neutralised as an Australian. That's the last time I get trapped
by answering the 'easy' questions!

Chris
CFB Software
http://www.cfbsoftware.com.au

"Dr John Stockton" <spam@merlyn.demon.co.uk> wrote in message
news:oHIGdkMVRt36EwdT@merlyn.demon.co.uk...
> JRS: In article <3ade7bdb@news.iprimus.com.au>, seen in news:comp.lang.
> pascal.delphi.misc, CFB Software <info@cfbsoftware.com.au> wrote at Thu,
> 19 Apr 2001 14:27:43 :-
>
> >"Maarten" <mvddonk@wish.nl> wrote in message
> >news:987631802.275373@news.l3.wish.net...
> >> Can anyone help me with this program i'm trying to make !?
> >> The idea of the program is to simulatie the throwing of a die.
>
> >Randomize; // Call once only to initialise
> >....
> >....
> >DieThrow := Random(5) + 1;
> >
> >Each execution of this statement will assign a random number in the range
1
> >to 6 to DieThrow if that is what you are trying to do,
>
> Quoting order corrected.
>
> Never play dice with an Australian; theirs are evidently configured
> never to show a six.
>
> --
> © John Stockton, Surrey, UK. jrs@merlyn.demon.co.uk Turnpike v4.00
MIME. ©
> <URL: http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics &
links;
> <URL: http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b.
mFAQ;
> <URL: ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal
FAQ.



Barney Tyrwhitt-Drak~ (19-04-2001)
Kommentar
Fra : Barney Tyrwhitt-Drak~


Dato : 19-04-01 13:49

In article <3ADED429.1C9CDC4A@privacy.net>, James Roberts
<me@privacy.net> writes
>Wouldn't the results of Random(5) be 0 through 5? If so, then
>Random(5)+1 would yield 1 through 6.
>
Yes, but dice in Holland have 6 faces with from 1 to 6 spots on them.
Clearly the all-American super whizzo die with choice of toppings is
different.
--
Barney Tyrwhitt-Drake

Drake Software web site: http://www.tdrake.demon.co.uk

Bruce Roberts (20-04-2001)
Kommentar
Fra : Bruce Roberts


Dato : 20-04-01 15:34


"Barney Tyrwhitt-Drake" <Barney@tdrake.demon.co.uk> wrote in message

> Yes, but dice in Holland have 6 faces with from 1 to 6 spots on them.
> Clearly the all-American super whizzo die with choice of toppings is
> different.

I think they call it "house odds" in Vegas :).



Søg
Reklame
Statistik
Spørgsmål : 177559
Tips : 31968
Nyheder : 719565
Indlæg : 6408938
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste