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

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

From:
jquelin
Date:
January 7, 2009 10:13
Subject:
[svn:parrot] r35156 - trunk/languages/befunge
Message ID:
20090107181303.BD2FACB9F9@x12.develooper.com
Author: jquelin
Date: Wed Jan  7 10:13:03 2009
New Revision: 35156

Modified:
   trunk/languages/befunge/befunge.pir
   trunk/languages/befunge/flow.pir

Log:
instruction > implemented


Modified: trunk/languages/befunge/befunge.pir
==============================================================================
--- trunk/languages/befunge/befunge.pir	(original)
+++ trunk/languages/befunge/befunge.pir	Wed Jan  7 10:13:03 2009
@@ -75,6 +75,7 @@
     # sole number
     
     # direction changing
+    if char == '>' goto FLOW_GO_EAST
     if char == '<' goto FLOW_GO_WEST
     
     # unknown instruction
@@ -130,6 +131,9 @@
 
 =cut
 
+  FLOW_GO_EAST:
+    flow__go_east()
+    goto MOVE_PC
   FLOW_GO_WEST:
     flow__go_west()
     goto MOVE_PC

Modified: trunk/languages/befunge/flow.pir
==============================================================================
--- trunk/languages/befunge/flow.pir	(original)
+++ trunk/languages/befunge/flow.pir	Wed Jan  7 10:13:03 2009
@@ -1,6 +1,16 @@
 # $Id$
 
 #
+# go east.
+# befunge stack unchanged.
+# delta <- (1,0)
+.sub "flow__go_east"
+    $P0 = get_global "status"
+    $P0["dir"] = 1
+    set_global "status", $P0
+.end
+
+#
 # go west.
 # befunge stack unchanged.
 # delta <- (-1,0)
@@ -21,13 +31,6 @@
     set I2, 0
     branch MOVE_PC
 
-# Go east.
-# Befunge stack unchanged.
-# delta <- (1,0)
-FLOW_GO_EAST:
-    set I2, 1
-    branch MOVE_PC
-
 # Go south.
 # Befunge stack unchanged.
 # delta <- (0,1)



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