[REBOL] Technoooology ... Chirp Chirp
From: reffy::ulrich::net at: 22-Oct-2002 21:49
Gawd, I hate when I get in this mood !!
Would someone tell me how to code the following in XML ?
Of course I am teasing !! Chirp, Chirp, Chirp
-- a function executed when a sphere is clicked
-- ; begins local variables on function definition line
-- execution is right to left unless overridden with parenthesis
-- attributes are associated with LVALUES using :
Define Ouch ioe ; id obj evt parent cube oldxyz newxyz
{
id obj evt Is ioe
parent Is obj:'parent'
cube Is parent:'size' - obj:'radius'
-- move the sphere to a new position within the scene
-- such that it will not make another sphere invisible
-- and will be wholly contained within the Scene
While obj:'xyz' In parent[1 ... LengthOf parent]:'xyz'
obj:'xyz' Is Random cube
AmigaSay 'My name is: ' (obj:'name') (obj:'chirp'[Random LengthOf obj:'chirp'])
}
Scene Is # # # -- 3 undefined values
-- a vector of strings to do random chirping
chirp Is \
"Ouch, don't touch me!" \
"You are getting rather personal!" \
"Will you please quit it!" \
"Don't you have anything else to do?" \
"Go learn Rebol fool!"
Scene:'size' 'sizeunit' Is (36 36 36) 'inches'
Scene[1]:'type' 'name' 'xyz' 'radius' 'surfmatl' 'onclick' 'chirp' Is \
'sphere' 's1' (1 1 1) 1 'chrome' 'Ouch' ('s1: ' Join chirp)
Scene[2]:'type' 'name' 'xyz' 'radius' 'surfmatl' 'onclick' 'chirp' Is \
'sphere' 's2' (12 22 2) 1 'wood' 'Ouch' ('s2: ' Join chirp)
Scene[3]:'type' 'name' 'xyz' 'radius' 'surfmatl' 'onclick' 'chirp' Is \
'sphere' 's2' (17 6 32) 1 'brick' 'Ouch' ('s3: ' Join chirp)
View3D Scene