Commits

Pierre Surply committed 4ab7b1f

Added shared library

  • Participants
  • Parent commits 11b752e

Comments (0)

Files changed (4)

 
    LABEL recv_position
       LET B A
-      PUSH B
       PUSH C
       PUSH D
 
       
       LET A B
       GOTOSUB listen_channel
-      LET D C | A
+      LET D D | A
 
       LET A C
       LET B D
 
       POP D
       POP C
-      POP B
    RETURN
 
 LABEL end_com

File res/lib/move

        GOTO end_set_orient
        LABEL set_orient_back
          CALL rotleft
-	 CALL rotleft
+         CALL rotleft
        GOTO end_set_orient
        LABEL set_orient_right
          CALL rotright
       GOTO start_move_to
          LABEL error_move_to
             PRINT Cannot find path to ( $A , $B )
-	    GOTO end_move_to
+      GOTO end_move_to
       LABEL start_move_to
       PUSH C
       CALL findpath C
       POP A
       WHILE A != 5
          GOTOSUB set_orient
-	 CALL forward
+         CALL forward
          POP A
       ENDWHILE
       LABEL end_move_to

File src/robot/robot.py

 ##    along with BASIC-RoBots.  If not, see <http://www.gnu.org/licenses/>.
 ## 
 ## Started on  Sun Jul  1 15:34:10 2012 Pierre Surply
-## Last update Sat Aug 18 13:58:11 2012 Pierre Surply
+## Last update Sun Aug 19 15:07:02 2012 Pierre Surply
 ##
 
 import os
+import shutil
 import random
 from collections import deque
 from pygame.locals import *
         self.name = new_name
         os.makedirs("saves/"+self.world+"/robots/"+self.name+"/fs")
         self.inv.path = "saves/"+self.world+"/robots/"+self.name+"/inv"
+        shutil.copytree("saves/"+self.world+"/lib", \
+                            "saves/"+self.world+"/robots/"+self.name+"/fs/lib")
 
     def get_pos(self):
         return (self.pos_x, self.pos_y)

File src/robot/robotsos.py

 ##    along with BASIC-RoBots.  If not, see <http://www.gnu.org/licenses/>.
 ##  
 ## Started on  Wed May  9 22:56:00 2012 Pierre Surply
-## Last update Thu Aug 16 18:18:08 2012 Pierre Surply
+## Last update Sun Aug 19 16:15:18 2012 Pierre Surply
 ##
 
 import os
+import shutil
 from pygame.locals import *
 
 os.chdir('src/robot')
                            ("let", "REG VALUE", "set register value", lambda o, a: o.let(a)),\
                            ("stack", "", "print stack", lambda o, a: o.stack(a)),\
                            ("tree", "", "", lambda o, a: o.tree(a)),\
+                           ("pulllib", "", "", lambda o, a: o.pulllib()),\
+                           ("pushlib", "", "", lambda o, a: o.pushlib()),\
                            ("clear", "", "clear screen", lambda o, a: o.clear(a))])
         if self.robot.energy > 0:
             self.welcome(None)
                 self.rec_tree(True, dec+1, path+l[-1]+"/")
             else:
                 self.terminal.write_line(c * dec + "\xc0\xc4\xc4" + l[-1])
+
+    def pulllib(self):
+        if os.path.isdir(self.get_path("/lib")):
+            shutil.rmtree(self.get_path("/lib"))
+        shutil.copytree("saves/" + self.robot.world + "/lib", self.get_path("/lib"))
+        self.terminal.write_line("Pulled library")
+
+    def pushlib(self):
+        shutil.rmtree("saves/" + self.robot.world + "/lib")
+        shutil.copytree(self.get_path("/lib"), "saves/" + self.robot.world + "/lib")
+        self.terminal.write_line("Pushed library")