Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: "MicroWorlds Forum" <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: problem with snake's game
From: "Daniel Ajoy" <da.ajoy@xxxxxxxxx>
Date: Tue, 31 Jan 2012 16:32:36 -0500

On Wed, 25 Jan 2012 13:36:06 -0500, zehava wizman <zehavawi1@xxxxxxxxx> wrote:

Hello Forum
When I want to play with 2 solders, the condition "and" does not work, I want that each one (red and green) will activate according to the key pushed on, and according to the que.
What is the problem?
here attached the project.
thanks, Zehava

I'm sorry I didn't answer before.

It is also a shame that no one else chimed in.

I don't notice anything wrong with the AND commands there.

They do what you tell them to do.

For example,

when text2 is 1 then the t3 turtle moves

when text2 is not 1 then the t1 turtle moves


On the other hand, instead of this:

to direct
let [key readchar]
ifelse and ((ascii :key) = 37) (text2 = 1)
[t3,  left2][t1, left2]

ifelse and ((ascii :key) = 38) (text2 = 1)
[t3,  up][t1, up]

ifelse and ((ascii :key) = 39) (text2 = 1)
[t3,  righ1][t1, righ1]

ifelse and ((ascii :key) = 40) (text2 = 1)
[t3,  down][t1, down]

end

I would have written it like this:


to direct
let [ascii key readchar]

talkto ifelse text2 = 1 ["t3] ["t1]

if :key = 37 [left2]
if :key = 38 [up]
if :key = 39 [righ1]
if :key = 40 [down]
end


Daniel
OpenWorld Learning



  • Previous by thread: problem with snake's game
  • Next by thread: MIA, Ask an Expert: mia

  • 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.


    © copyright 2001 - 2008