develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35064 - trunk/languages/befunge

From:
jquelin
Date:
January 6, 2009 10:40
Subject:
[svn:parrot] r35064 - trunk/languages/befunge
Message ID:
20090106184000.9AB57CB9F9@x12.develooper.com
Author: jquelin
Date: Tue Jan  6 10:39:59 2009
New Revision: 35064

Modified:
   trunk/languages/befunge/befunge.pir

Log:
initializing vars being used later on


Modified: trunk/languages/befunge/befunge.pir
==============================================================================
--- trunk/languages/befunge/befunge.pir	(original)
+++ trunk/languages/befunge/befunge.pir	Tue Jan  6 10:39:59 2009
@@ -2,12 +2,12 @@
 
 .include "debug.pir"
 .include "load.pir"
+.include "maths.pir"
 
 =pod
 
 .include "flow.pasm"
 .include "io.pasm"
-.include "maths.pasm"
 .include "stack.pasm"
 
 =cut
@@ -21,25 +21,38 @@
     #getstdout stdout
     #pioctl I10, P10, 3, 0
 
+    # parsing argv
     .local int debug
     .local pmc playfield
     (debug, playfield) = _parse_argv(argv)
 
+    # various inits
+    .local int x, y, dir, flag
+    x = 0       # x coord of the pc
+    y = 0       # y coord of the pc
+    dir  = 1    # direction of the pc
+    flag = 0    # 1=string-mode, 2=bridge, 3=end
+    
+    .local pmc stack
+    stack = new 'ResizablePMCArray'
+    
+    .local num seed
+    seed = time
+    seed = mod seed, .RANDMAX
 
-=pod
-
-        set S10, P5[I0]
-        save S10
-        bsr LOAD
-        restore P1              # P1 = the playfield
-        new P2, .ResizablePMCArray      # P2 = the stack
-        set I0, 0               # I0 = x coord of the PC
-        set I1, 0               # I1 = y coord of the PC
-        set I2, 1               # I2 = direction of the PC
-        set I4, 0               # I4 = flag (1=string-mode,2=bridge,3=end)
-        time N0                 # N0 = random seed
-        mod N0, N0, .RANDMAX
-        set S2, ""              # S2 = user input
+    .local string user_input
+    user_input = ""
+    
+        # I5 is debug
+        #set S10, P5[I0] ??
+        # P1 = the playfield
+        # P2 = the stack
+        # I0 = x coord of the PC
+        # I1 = y coord of the PC
+        # I2 = direction of the PC
+        # I4 = flag (1=string-mode,2=bridge,3=end)
+        # N0 = random seed
+        # S2 = user input
 
 =pod
 



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About