Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. def clicky(node):
  2.     """sets the origin and endpoint nodes"""
  3.  
  4.     global origin, endpoint, finished
  5.  
  6.     if origin == 0:
  7.         origin = node
  8.         node.highlight(color = Color.RED, size = node.size()*1.5)
  9.         node.set_color(color = Color.RED)
  10.         node.set_label('origin', label_id = 1).set_size(size = 15)
  11.         node.set_label(0, label_id = 0)
  12.         print('origin: ' + str(origin.id()))
  13.  
  14.     elif endpoint == 0:
  15.         endpoint = node
  16.         node.highlight(color = Color.RED, size = node.size()*1.5)
  17.         node.set_color(color = Color.RED)
  18.         node.set_label('target', label_id = 1).set_size(size = 15)
  19.         print('target: ' + str(endpoint.id()))
  20.  
  21.         print(bfs())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement