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: Sat, 22 Jun 2019 12:03:18 +0100 Organization: None Lines: 32 Message-ID: <57c815b263basura@invalid.addr.uk> References: <57c7c5d6c0basura@invalid.addr.uk> X-Trace: individual.net Dae0tiX242THdfNZUTKDOwf5YSMXWAlGx5ge7hXG4VVfBTDExo X-Orig-Path: uwclub.net!richard.ashbery Cancel-Lock: sha1:sa6/cwsdmHUKIu1nRfWcGdm/96o= User-Agent: Pluto/3.16 (RISC OS/5.25) NewsHound/v1.52-32 Xref: csiph.com comp.sys.acorn.programmer:5773 In article , druck wrote: > On 21/06/2019 22:27, Gavin Crawford wrote: > > Richard Ashbery Wrote in message: > >> The following variables can be used to calculate precise > >> anglesthrough which an object can be rotated. The first rotates > >> objectthrough 360/3 = 120 degrees, the next one 360/4 = 90 > >> degrees and soon. Each calculation creates an integer with no > >> decimal places.3,4,5,6,8,9,10,12,15,18,20,24,30,36,45,60,90,120I > >> would like to be able to use these variables in a random > >> sequence.Has anyone a BASIC routine that could do this please? > Any reason 2 and 180 aren't used? Good question: 2 objects looked a little odd in the animation so I went for 3 as a minimum. > > Why not put them into an array and use a random number to choose > > the array index. > Yes, and make sure you seed the random number generator, or it may > always go through the same pseudo random sequence each time its run. > IIRC to seed do RND(-TIME) before any other call to RND. Thanks guys for your help as always. The array method should work. RND(-TIME) is a great idea to get non-repeating random numbers. Many thanks Richard