view [
b: button extra 'a [probe get in get face/extra 'text]
a: area "this is an area text"
]
@9214 A simple "" made me crazy....
I have a bunch of dynamically created buttons
Their face/data content refer to dynamically created areas objects
foreach [tag name] buttons [
keep compose [
(to set-word! name) area 300x50 (copy "") wrap
]
]
The function executed when I hit one of the buttons pass the face/data, which is <areaname> ,and then I print <areaname>/text....
I always had the same printed result despite the button I hit....
Four hours to discover that tiny "" had to be changed to (copy "") !
Does anyone knows the Logo? You can play with it here.
I want to mimic Logo's functionality. What I need is to keep a) current pen position and b) rotation. shape
sub-dialect keeps pen position but it does not know about rotation. I have found out that I can rotate over some point (rotate <degree> <point>
). However I am rotating using values computed by me. Here is an example. I want to draw square.
The Logo code:
; just so we can start as Red's shape
right 90
forward 40
right 90
forward 40
right 90
forward 40
right 90
forward 40
and here is the Red's code:
view [base 300x300 red draw [
shape [ move 100x100 ]
shape [ 'line 40x0 ]
rotate 90 140x100
shape ['line 40x0]
rotate 90 180x100
shape ['line 40x0 ]
rotate 90 220x100
shape ['line 40x0 ]
]
]
Is there some function or word that keeps current pen position? I want to use it like rotate 90 _pen-position_
instead of hard-coded rotate 90 220x100
.
view [
style small: area 30x30
button button button return
button button button return
area below small small small
]
<center>
parameter ( (optional) center of rotation (pair!)) doesn't matter. We should calculate <center>
parameter other way.
draw
/shape
of the Logo's features (rotation/heading, loops, conditions, functions etc)?