samedi 1 novembre 2014

Which control primative should I use to avoid a syntax error during compilation?


Vote count:

0




What I am attempting to do here is to make certain patches with certain colours either spawn or kill turtles and the road patches (colour grey) impose changes in headings on the turtles depending on what the user has selected in the interface. I have used a while control primitive within my code however the compiler reports the error message: " If expected two inputs, a TRUE/ FALSE and a command block." I want the heading of the cars being spawned on the blue squares to remain 90 only when they are on the blue square and to change to whatever the user defines when the car is travelling along the road. How should I change the while control primitive to prevent a compiler error?



to edit-world-secondary

ask turtles-on patches with [pcolor = grey]
[control-movement]


ask patches with [pcolor = blue]
[ crt 10[ init-car]]
while [turtles-on patches with [pcolor = blue] [ set heading 90]
]

ask turtles-on patches with [pcolor = orange][process-sinks]

end


asked 30 secs ago







Which control primative should I use to avoid a syntax error during compilation?

Aucun commentaire:

Enregistrer un commentaire