[Thread Prev] [Thread Next]
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
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.
|