I am using Logo and I have certain problems while iterating through list. What is the problem with the line.
if count :L = 0 [stop]
The :L is a list. So, I would like to test the length of list and stop after the list is empty.
I am using Logo and I have certain problems while iterating through list. What is the problem with the line.
if count :L = 0 [stop]
The :L is a list. So, I would like to test the length of list and stop after the list is empty.
Copyright © 2021 Jogjafile Inc.
You need to wrap the count command in parentheses so that it is evaluated first:
It also wouldn't hurt to add additional parentheses around the entire test and also add the empty brackets for the else clause (if required by your logo interpreter):
Bear in mind,
stopis used to exit a procedure. If all you want to do is exit out of a loop, you may want to look at other loop structures like afor,whileoruntilloop.