[comp.sys.mac.hypercard] Random Selection of Cards

wood@vaxwaller.UUCP (John Wood) (06/29/88)

I have an application for hypercard in which I would like to be
able to select a card randomly (via the pseudo-random number 
generator function) in response to clicking on a button.  If this
can be done please tell me how, if not tell me why.  Thanks.

	John Wood		(415) 945-2273
	Varian Instruments, 2700 Mitchell Dr.  Walnut Creek, Ca. 94598
	{zehntel,dual,amd,fortune,rtech,lll-crg,ista,pacbell,csi}!varian!wood
	(These are my opinions.  I don't know what Varian's opinions are.)
-- 
	John Wood		(415) 945-2273
	Varian Instruments, 2700 Mitchell Dr.  Walnut Creek, Ca. 94598
	{zehntel,dual,amd,fortune,rtech,lll-crg,ista,pacbell,csi}!varian!wood
	(These are my opinions.  I don't know what Varian's opinions are.)

sinteur@uvabick.UUCP (John Sinteur) (07/01/88)

that can be done... sure:

On mouseup
  get random(the number of cards)
  go to card it
end mouseup

I'm doing the syntax of the top of my head, but this more or less is it.

John Sinteur             One good reason why computers can do
SINTEUR@UVABICK.uucp,           more work than man is that they never
HOL.MIS@AppleLink,           have to stop to answer the phone
AERTS@HLERUL5.bitnet,
Disclaimer: MY opinions only, not those of my employer or anyone else.

 

fry@huma1.HARVARD.EDU (David Fry) (07/02/88)

In article <275@uvabick.UUCP> sinteur@uvabick.UUCP (John Sinteur) writes:
>
>that can be done... sure:
>
>On mouseup
>  get random(the number of cards)
>  go to card it
>end mouseup

More simply, and using the unique nature of HyperTalk:

on mouseUp
	go to any card
end mouseUp

David Fry				fry@zariski.harvard.EDU
Department of Mathematics		fry@zariski.bitnet
Harvard University			...!harvard!zariski!fry
Cambridge, MA  02138		

halff@nprdc.arpa (Henry Halff) (07/07/88)

In article <1788@vaxwaller.UUCP> wood@vaxwaller.UUCP (John Wood) writes:
>
>I have an application for hypercard in which I would like to be
>able to select a card randomly (via the pseudo-random number 
>generator function) in response to clicking on a button.

Put this script in the button

on mouseup
   go to card random(number of cards)
end mouseup

hh

thomas@uvabick.UUCP (Thomas Fruin) (07/13/88)

By far the easiest way to go to a random card, is to use:

  go to any card

Don't you love HyperCard?  :)

-- Thomas Fruin

   fruin@hlerul5.BITNET                         University of Leiden
   thomas@uvabick.UUCP                          University of Amsterdam
   dibs@well.UUCP
   hol0066.AppleLink
   2:512/114.FidoNet                            The Netherlands