Beautiful solution! The arrays are probably much faster than the
regular expressions too. And I learned a new command: Combine.
Thanks for teaching me. : )
On Dec 10, 2005, at 6:52 AM, Jim Hurley wrote:
on mouseUP
put field 1 into tText
put char 1 of tText into tLastChar
Message: 7
Date: Fri, 9 Dec 2005 13:58:46 -0700
From: Mark Greenberg [EMAIL PROTECTED]
Subject: Re: Heads Tails
To: use-revolution@lists.runrev.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=US-ASCII; delsp=yes;
format=flowed
Yes, but the original post (quite a while
Here's another solution for the problem of finding the runs of heads
in a series of coin flips:
Function TheRuns Data --in the form of tthttthhth...
Local P1, P2=1
Repeat with i = 1 to 12
Put True into M;Put Data into D;Put 0 into Ct
Repeat until M is False
Put MatchChunk
Message: 5
Date: Fri, 9 Dec 2005 04:35:10 -0700
From: Mark Greenberg [EMAIL PROTECTED]
Subject: Heads Tails
To: Runtime Revolution use-revolution@lists.runrev.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=US-ASCII; delsp=yes;
format=flowed
Here's another solution
Yes, but the original post (quite a while ago) was looking for a way
to determine how many times h occurred in singles, doubles, triples,
etc. Your script counts how many heads and tails there are total.
There were some non-RegEx solutions offered, but they were long.
RegEx shortens the