3 ms·
OK, mine is the result of running this pseudocode: # Label all streets as much as possible for (each street on screen): while (that street has room
by logicallee 8y ago
OK, mine is the result of running this pseudocode:
# Label all streets as much as possible
for (each street on screen):
while (that street has room for a label): # (even if already labeled)
put a label on that street # i.e. an additional one
yours is:
# Try to label unlabeled streets
for (each street on screen)
if (no label on screen for that street): # if unlabeled
if (street has room for a label): # ...can we fix?
put a label on that street # ...then fix
(I would usually write this with an && rather than nested if's but I know mobile makes you scroll sideways)
As a followup, could you please define "street has room for a label"? When do you consider that a street has room for a label?