silly, but what's wrong?
[1/7] from: balayo::mindspring::com at: 30-Jul-2001 15:53
hey guys,
If I run this from the rebol prompt, it works, if I call it, it
does not. What's wrong?
REBOL [
File: %random-sig.r
]
sig: [
{^/--^/^/Having too much fun.^/-tom}
{^/--^/^/Insert witty saying here.^/-tom}
{^/--^/^/Spend less time composing sigs.^/-tom}
{^/--^/^/Turn your computer off. Go outside.^/-tom}
{^/--^/^/Eat more spinach.^/-tom}
{^/--^/^/Loving every minute of it.^/-tom}
]
write %.signature pick sig random/seed (length? sig)
--
<insert something witty here>
balayoatmindspringdotcom
-tom
[2/7] from: jelinem1:nationwide at: 30-Jul-2001 16:22
When I cut-paste this into the command line I get an error. random/seed
does not return anything, I have to remove the /seed.
- Michael Jelinek
Tom Foster <[balayo--mindspring--com]>
Sent by: tom <[tf--www--mindspring--com]>
07/30/01 02:53 PM
Please respond to rebol-list
T
To: REBOL List <[rebol-list--rebol--com]>
cc:
bcc:
Subject: [REBOL] silly, but what's wrong?
hey guys,
If I run this from the rebol prompt, it works, if I call it, it
does not. What's wrong?
REBOL [
File: %random-sig.r
]
sig: [
{^/--^/^/Having too much fun.^/-tom}
{^/--^/^/Insert witty saying here.^/-tom}
{^/--^/^/Spend less time composing sigs.^/-tom}
{^/--^/^/Turn your computer off. Go outside.^/-tom}
{^/--^/^/Eat more spinach.^/-tom}
{^/--^/^/Loving every minute of it.^/-tom}
]
write %.signature pick sig random/seed (length? sig)
--
<insert something witty here>
balayoatmindspringdotcom
-tom
[3/7] from: joel:neely:fedex at: 30-Jul-2001 16:30
Hi, Tom,
Tom Foster wrote:
> hey guys,
>
> If I run this from the rebol prompt, it works, if I call it,
> it does not.
>
Could you describe "does not" -- error messages, etc.?
> write %.signature pick sig random/seed (length? sig)
>
I changed the line above to
write %.signature random/only sig
and it works fine both as a script and pasted into the console
window.
Hope this helps!
-jn-
--
This sentence contradicts itself -- no actually it doesn't.
-- Doug Hofstadter
joel<dot>neely<at>fedex<dot>com
[4/7] from: balayo:mindspring at: 30-Jul-2001 19:37
On Mon, Jul 30, 2001 at 04:30:03PM -0500, Joel Neely wrote:
> Hi, Tom,
> Could you describe "does not" -- error messages, etc.?
<<quoted lines omitted: 7>>
> Hope this helps!
> -jn-
Hi Joel,
The script just always wrote the same sig. I'll try your
change, thanks!
--
<insert something witty here>
balayoatmindspringdotcom
-tom
[5/7] from: larry:ecotope at: 30-Jul-2001 18:05
Hi Tom
In most languages RANDOM is by default seeded with a dynamic value derived
from the system clock. In REBOL, RANDOM is by default set with a seed of 1.
So the sequence of values returned by RANDOM is always the same (i.e., the
first use of RANDOM with a given argument always produces the same value).
>> random 100
== 95
>> random 100
== 52
>> random/seed 1
>> random 100
== 95
So the first value returned for random 100 is always 95 and the second is
always 52. Setting the seed back to one starts the sequence over.
If you want RANDOM to produce a different sequence of values every time the
code runs, you need to initialize the seed with a dynamic value like the
system time.
>> random/seed now
>> random 100
== 71
>> random/seed now
>> random 100
== 3
HTH
-Larry
[6/7] from: balayo:mindspring at: 30-Jul-2001 23:12
hey again,
my little random sig script still does not work when I call it
like this:
bash~>> rebol -sq random-sig.r
This is different than when I say:
REBOL>> do %random-sig.r
is that strange, or just me?
On Mon, Jul 30, 2001 at 04:30:03PM -0500, Joel Neely wrote:
> Hi, Tom,
> Tom Foster wrote:
<<quoted lines omitted: 22>>
> [rebol-request--rebol--com] with "unsubscribe" in the
> subject, without the quotes.
--
<insert something witty here>
balayoatmindspringdotcom
-tom
[7/7] from: balayo:mindspring at: 30-Jul-2001 23:23
On Mon, Jul 30, 2001 at 04:22:45PM -0500, [JELINEM1--nationwide--com] wrote:
> When I cut-paste this into the command line I get an error. random/seed
> does not return anything, I have to remove the /seed.
>
> - Michael Jelinek
>
oops. I have to remove the /seed too, the way I posted it. I
sent an earlier attempt...
<insert something witty here> (I will soon!)
balayoatmindspringdotcom
-tom
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted