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:10:43 +0100 Organization: None Lines: 32 Message-ID: <57c8a5327abasura@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 m5OHSAE/iF50HmlDJCSM6QSi6fzbHgLhT+L99QY3KVxOqHe2Fu X-Orig-Path: uwclub.net!richard.ashbery Cancel-Lock: sha1:hMr4J4VlEgDwh70fefYR/N8c7jo= User-Agent: Pluto/3.16 (RISC OS/5.25) NewsHound/v1.52-32 Xref: csiph.com comp.sys.acorn.programmer:5786 In article , Steve Fryatt wrote: > On 23 Jun, Ian wrote in message > <20190623120736.3390b842@ian-460-p050na>: > > 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 haven't tested it. > > > > HTH, Ian > It would be better to leave > array%()=3,4,5,6,8 ... > and then do > PRINT array%(RND(18) - 1) No that doesn't work - it fails to take into account the last number in the array (120). Ian's method does work with all numbers being randomly displayed, albeit with some numbers displayed consecutively. Regards Richard