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

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

From:
jquelin
Date:
January 7, 2009 10:21
Subject:
[svn:parrot] r35160 - trunk/languages/befunge
Message ID:
20090107182105.D4DF0CB9F9@x12.develooper.com
Author: jquelin
Date: Wed Jan  7 10:21:05 2009
New Revision: 35160

Modified:
   trunk/languages/befunge/io.pir

Log:
replaced tabs by 4 spaces


Modified: trunk/languages/befunge/io.pir
==============================================================================
--- trunk/languages/befunge/io.pir	(original)
+++ trunk/languages/befunge/io.pir	Wed Jan  7 10:21:05 2009
@@ -8,9 +8,9 @@
 #   after:      ... c
 # i = ord(current char)
 IO_PUSH_CHAR:
-        ord I10, S0
-        push P2, I10
-        branch MOVE_PC
+    ord I10, S0
+    push P2, I10
+    branch MOVE_PC
 
 # Input integer.
 # Befunge stack:
@@ -18,29 +18,29 @@
 #   after:      ... i
 # i = readint()
 IO_INPUT_INT:
-        save S2
-        restore S2
-        length I10, S2
-        gt I10, 0, IO_INPUT_INT_PARSE_INPUT
-        getstdin P15
-        readline S2, P15
-        length I10, S2
+    save S2
+    restore S2
+    length I10, S2
+    gt I10, 0, IO_INPUT_INT_PARSE_INPUT
+    getstdin P15
+    readline S2, P15
+    length I10, S2
 IO_INPUT_INT_PARSE_INPUT:
-        set I11, 0
-        set S10, ""
+    set I11, 0
+    set S10, ""
 IO_INPUT_INT_NEXT_CHAR:
-        substr S11, S2, I11, 1
-        lt S11, "0", IO_INPUT_INT_NAN
-        gt S11, "9", IO_INPUT_INT_NAN
-        concat S10, S10, S11
-        inc I11
-        lt I11, I10, IO_INPUT_INT_NEXT_CHAR
-        set I10, 0
-        set I11, 0
+    substr S11, S2, I11, 1
+    lt S11, "0", IO_INPUT_INT_NAN
+    gt S11, "9", IO_INPUT_INT_NAN
+    concat S10, S10, S11
+    inc I11
+    lt I11, I10, IO_INPUT_INT_NEXT_CHAR
+    set I10, 0
+    set I11, 0
 IO_INPUT_INT_NAN:
-        substr S2, S2, I11, I10
-        push P2, S10
-        branch MOVE_PC
+    substr S2, S2, I11, I10
+    push P2, S10
+    branch MOVE_PC
 
 # Input character.
 # Befunge stack:
@@ -48,21 +48,21 @@
 #   after:      ... c
 # c = getchar()
 IO_INPUT_CHAR:
-        save S2
-        restore S2
-        length I10, S2
-        gt I10, 0, IO_INPUT_CHAR_SUBSTR
-        getstdin P15
-        readline S2, P15
+    save S2
+    restore S2
+    length I10, S2
+    gt I10, 0, IO_INPUT_CHAR_SUBSTR
+    getstdin P15
+    readline S2, P15
 IO_INPUT_CHAR_SUBSTR:
-        substr S10, S2, 0, 1
-        length I10, S2
-        substr S2, S2, 1, I10
-        ord I10, S10
-        push P2, I10
-        save S2
-        restore S2
-        branch MOVE_PC
+    substr S10, S2, 0, 1
+    length I10, S2
+    substr S2, S2, 1, I10
+    ord I10, S10
+    push P2, I10
+    save S2
+    restore S2
+    branch MOVE_PC
 
 # Output integer.
 # Befunge stack:
@@ -70,13 +70,13 @@
 #   after:      ...
 # writeint(i)
 IO_OUTPUT_INT:
-        set I10, P2
-        unless I10, IO_OUTPUT_INT_POP_1
-        pop I10, P2
+    set I10, P2
+    unless I10, IO_OUTPUT_INT_POP_1
+    pop I10, P2
 IO_OUTPUT_INT_POP_1:
-        print I10
-        print " "
-        branch MOVE_PC
+    print I10
+    print " "
+    branch MOVE_PC
 
 # Output character.
 # Befunge stack:
@@ -84,13 +84,13 @@
 #   after:      ...
 # writechar( chr(i) )
 IO_OUTPUT_CHAR:
-        set I10, P2
-        unless I10, IO_OUTPUT_CHAR_POP_1
-        pop I10, P2
+    set I10, P2
+    unless I10, IO_OUTPUT_CHAR_POP_1
+    pop I10, P2
 IO_OUTPUT_CHAR_POP_1:
-        chr S10, I10
-        print S10
-        branch MOVE_PC
+    chr S10, I10
+    print S10
+    branch MOVE_PC
 
 # Get a value from playfield.
 # Befunge stack:
@@ -98,17 +98,17 @@
 #   after:      ... i
 # i = value_at(x,y)
 IO_GET_VALUE:
-        set I11, P2
-        unless I11, IO_GET_VALUE_POP_1
-        pop I11, P2
+    set I11, P2
+    unless I11, IO_GET_VALUE_POP_1
+    pop I11, P2
 IO_GET_VALUE_POP_1:
-        set I10, P2
-        unless I10, IO_GET_VALUE_POP_2
-        pop I10, P2
+    set I10, P2
+    unless I10, IO_GET_VALUE_POP_2
+    pop I10, P2
 IO_GET_VALUE_POP_2:
-        set I12, P1[I11;I10]
-        push P2, I12
-        branch MOVE_PC
+    set I12, P1[I11;I10]
+    push P2, I12
+    branch MOVE_PC
 
 # Put a value in the playfield.
 # Befunge stack:
@@ -116,20 +116,20 @@
 #   after:      ...
 # value_at(x,y) = i
 IO_PUT_VALUE:
-        set I11, P2
-        unless I11, IO_PUT_VALUE_POP_1
-        pop I11, P2
+    set I11, P2
+    unless I11, IO_PUT_VALUE_POP_1
+    pop I11, P2
 IO_PUT_VALUE_POP_1:
-        set I10, P2             # offset
-        unless I10, IO_PUT_VALUE_POP_2
-        pop I10, P2
+    set I10, P2         # offset
+    unless I10, IO_PUT_VALUE_POP_2
+    pop I10, P2
 IO_PUT_VALUE_POP_2:
-        set I20, P2
-        unless I20, IO_PUT_VALUE_POP_3
-        pop I20, P2
+    set I20, P2
+    unless I20, IO_PUT_VALUE_POP_3
+    pop I20, P2
 IO_PUT_VALUE_POP_3:
-        set P1[I11;I10], I20
-        branch MOVE_PC
+    set P1[I11;I10], I20
+    branch MOVE_PC
 
 =cut
 



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