Simon

Untitled

Sep 28th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. local simonProgSource = [[
  2. function thisIsATest(integer self, integer x, integer y)
  3. neighbour n of self do
  4. //if n.type == [DEFAULT_PT_STNE] then
  5. // self.type = [DEFAULT_PT_CLNE]
  6. // self.ctype = [DEFAULT_PT_WATR]
  7. //elseif n.type == [DEFAULT_PT_PLUT] then
  8. // self.type = [DEFAULT_PT_BANG]
  9. //end
  10. n.type = [DEFAULT_PT_WATR]
  11. end
  12. end
  13. ]]
  14.  
  15. local prog = vm.loadProgram(simonProgSource);
  16. elem.allocate("SIMON", "TEST")
  17. elem.element(elem.SIMON_PT_TEST, elem.element(elem.DEFAULT_PT_PLUT))
  18. elem.property(elem.SIMON_PT_TEST, "Update", prog)
  19. elem.property(elem.SIMON_PT_TEST, "Name", "TEST")
Advertisement
Add Comment
Please, Sign In to add comment