[Thread Prev] [Thread Next]
Hi,
If you have the turtle names in a text box, try:
ask parse text1 [whatever]
TEXT1 reports the contents of the text box as a string of characters,
PARSE TEXT1 turns a string of characters into a clean list
To better understand, try:
SHOW TEXT1
SHOW COUNT TEXT1
SHOW PARSE TEXT1
SHOW COUNT PARSE TEXT1
Alain Tougas
alain@xxxxxxx
B: (514) 939-8700 poste 237
Le 07-01-09 à 23:21, zehava wizman a écrit :
Alain Hi!
I dont want all the turtles, only those that were clicked and
turned (2 cards each time). I did it with WHO instruction in each
card I clicked , and catched it to textbox , but if for example my
textbox have 2 lines written t7 and after t8, I want to take the
names and write a command t7, ht t8, ht or tto [t7 t8] ht.
Zehava
Alain Tougas <alain@xxxxxxx> wrote:
Hi,
To get the names of the turtles:
GET "PAGE1 "TURTLES
Use your page name instead of PAGE1
Best,
Alain
-----Original Message-----
From: mwforum-admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx [mailto:mwforum-
admin@xxxxxxxxxxxxxxxxxxxxxxxxxxxx]On Behalf Of zehava wizman
Sent: January 9, 2007 2:02 PM
To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [MWForum] Card's Game
Hello Alain!
I understand the problem with turtlesown, and I fixed it.
to the second question- to identify whether the two cards are the
same' I want to do it more simple, but I didnt succeeded to get the
names of the turned turtle, Is there an instruction to get the
names of the tutrles like get pos , get rule and so on.
there will be a procedure "right" that will get the name of the two
turtles and thenhide them' and another button "wrong" that will
turn the cards to their opposite side.
Thanks, Zehava Wizman
Alain LCSI <alain@xxxxxxx> wrote:
Hello,
Turtlesown is a command that you use "only once" in a given
project. Once done, you never have to do it again, the variable is
created. After a TURTLESOWN "TRY command, you can use SETTRY and
TRY instructions as much as you want. Your STARTUP procedure tries
to "recreate" the variable and it already exists. That's why you
have an error message.
Solution: remove the TURLTESOWN command in your startup procedure.
You don't need it at this point.
About finding pairs: You can take a look at the project PAIRS in
the project library (MW JR area at www.microworlds.com). It is a MW
JR project. You can see it in your browser if you have the
MicroWorlds EX plugin for Macintosh (Windows to come later)
One way to check if two flipped cards have the same shape (with
lots of "unknown" that I leave to you)
; run this once to create the project variable
createprojectvar "flippedcards
; the Onclick instruction of every card: FLIPANDCHECK
to flipandcheck
flipcard
; if the card you just flipped is the second flipped card...
if (count flippedcards) = 2 [compare]
end
to flipcard
; put the name of the current turtle in the list of flipped cards
setflippedcards fput who flippedcards
setsh ?whatever?
end
to compare
; compare the shape of the two flipped cards
ifelse (ask first flippedcard [shape]) = (ask last flippedcard
[shape])
[?whatevershouldhappen_ifmatch?]
[?whatevershouldhappen_ifnomatch?]
; reset the list of flipped cards to "empty"
setflippedcards [ ]
end
Alain Tougas
alain@xxxxxxx
B: (514) 939-8700 poste 237
Le 07-01-07 à 08:53, zehava wizman a écrit :
Hello Forum!
Here attached a project using turtlesown instruction.
1. Why there is an error message about it?
2/ How can I build a procedure that check if after clicking 2
cards- their shapes are the same, If not - it turned side, till we
guess all the pairs in the game.
I tried to use the values of turtlesown , but it didnt work.
Thanks, Zehava Wizman
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
<cards1.rar>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Previous by thread:
RE: Card's Game
Next by thread:
RE: Card's Game
To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.
|