Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!howland.reston.ans.net!usc!elroy.jpl.nasa.gov!netline.jpl.nasa.gov!csi!csi.jpl.nasa.gov!sam
From: sam@csi.jpl.nasa.gov (Sam Sirlin)
Subject: Re: Setting the seed in J
Message-ID: <1993May20.161925.8074@csi.jpl.nasa.gov>
Sender: usenet@csi.jpl.nasa.gov (Network Noise Transfer Service)
Nntp-Posting-Host: kalessin
Organization: Jet Propulsion Laboratory, Pasadena, CA
References:  <93139.214104HALTEMAN@MAINE.MAINE.EDU>
Date: Thu, 20 May 1993 16:19:25 GMT
Lines: 37

In article <93139.214104HALTEMAN@MAINE.MAINE.EDU>, <HALTEMAN@MAINE.MAINE.EDU> writes:
|> Greetings
|> 
|>     I apologize for such a trivial question.  I am new to J and am having
|> a little trouble with the cryptic dictionary.  Anyway, how does one change
|> the seed for the random number generator?  I have J6.2 for a PC.  I started
|> with 9!:1 15837 and have gotten "rank error" as the response.  I have tried
|> making the number a character, a vector, and a matrix (of dimension 1 x 1). I
|> have even tried 9!:1 9!:0 '', figuring the system would return the seed in the
|> form it wanted to get it. No such luck, still got "rank error".  Any help
|> would be greatly appreciated.


Consider the following:

   9!:0 ''
16807
   9!:1 0
rank error
   9!:1 (0)
domain error
   9!:1 (1)

   9!:0 ''
1
   9!:1 9!:0 ''
rank error

  9!:1 (9!:0 '')

I hope this makes things a bit clearer. (Extra hint: what is the right
argument?).

-- 
Sam Sirlin
Jet Propulsion Laboratory         sam@kalessin.jpl.nasa.gov

