Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Dec 25th, 2013  |  syntax: None  |  size: 0.60 KB  |  views: 40  |  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. FUNCTION automaticSystem::INIT
  2. SELF.ptr=ptr_new(/ALLOCATE)  
  3. RETURN, 1
  4. END
  5.  
  6. PRO automaticSystem__define
  7. void = {automaticSystem, ptr:ptr_new(), grid:[], cellCont:[1], agentID:[], agentCell:[], algorithmPurp:[], algorithms: []} ; not autoMATION, but -MATON
  8.  
  9.              RETURN
  10. END
  11.  
  12.  
  13.  
  14. FUNCTION automaticSystem::makeGrid, size
  15.        
  16.         old = 0
  17.         FOR i = 0,N_Elements(size)-1 DO BEGIN
  18.                 new = []
  19.                 FOR j = 0, size[i]-1 DO BEGIN
  20.                         new = [new,old]
  21.                 ENDFOR
  22.                 old = new
  23.         ENDFOR
  24.        
  25.         ; the final new is the answer
  26.         SELF.grid = new
  27. END
  28.  
  29.  
  30. FUNCTION automaticSystem::CLEANUP
  31.  
  32.  ptr_free,self.ptr
  33.  RETURN, 1
  34.  
  35. END