Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.45 KB  |  hits: 25  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. EVALUATING: set(dg, directed_graph(map(range(9), [value/3,value%3]), filter(links(v), inside_bounds(value)))) where links = def(v) [[v[0]-1,v[1]], [v[0]+1,v[1]], [v[0],v[1]-1], [v[0],v[1]+1]], inside_bounds = def(v) v[0]>=0 and v[1]>=0 and v[0]<3 and v[1]<3
  2. OUTPUT: (0D1A8540){}
  3. EVALUATING: set(wg, weighted_graph(dg, 10))
  4. OUTPUT: (0D1AA208){}
  5. EVALUATING: a_star_search(wg, [0,0], [2,2], distance(a,b))
  6. OUTPUT: [[0, 0], [1, 0], [2, 0], [2, 1], [2, 2]]