Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Richard Ashbery Newsgroups: comp.sys.acorn.programmer Subject: Re: Specific numbers but in a random sequence Date: Sun, 23 Jun 2019 14:01:44 +0100 Organization: None Lines: 32 Message-ID: <57c8a45ff1basura@invalid.addr.uk> References: <57c7c5d6c0basura@invalid.addr.uk> <57c82fa1bdbasura@invalid.addr.uk> <57c8384f3bbasura@invalid.addr.uk> <57c8955578basura@invalid.addr.uk> <20190623120736.3390b842@ian-460-p050na> X-Trace: individual.net xVzblE/1EVV9u0RSo3d+ogITrCQhe2JPYzZK70u4yNYK/QnC13 X-Orig-Path: uwclub.net!richard.ashbery Cancel-Lock: sha1:Suc5TnB80Qgv3MdfZkAHGcykTew= User-Agent: Pluto/3.16 (RISC OS/5.25) NewsHound/v1.52-32 Xref: csiph.com comp.sys.acorn.programmer:5785 In article <20190623120736.3390b842@ian-460-p050na>, Ian wrote: > On Sun, 23 Jun 2019 11:17:26 +0100 > Richard Ashbery wrote: [snip] > > > DIM array%(18) > > > array%() = 3,4,5,6,8,9,10,12,15,18,20,24,30,36,45,60,90,120 > > > y = RND(-TIME) > > > FOR loop = 1 TO 5 > > > FOR I% = 0 TO 18 > > > PRINT array%(RND(18)) > > > NEXT I% > > > NEXT loop > > >> There's only one problem which makes no > > sense to me in that 3 never appears but 0 does. > The array%() is being initialised from (0) to (17). (18) would contain > the zero. (0) contains the three. > Random numbers are 1 to 18. So three doesn't appear, zero does. > Add '0,' so that array%()=0,3,4,5,6,8 etc. and it should work. I have and I've now got my 3 back - excellent. Nice explanation. I haven't used arrays much so knowledge is lacking. Richard