File tree Expand file tree Collapse file tree 1 file changed +5
-16
lines changed
Expand file tree Collapse file tree 1 file changed +5
-16
lines changed Original file line number Diff line number Diff line change 77# Libreria necesaria para los argumentos.
88from sys import *
99
10+
11+ # Longitud maxima de las celdas
12+ LEN = 80000
13+
1014# Comprueba que los argumentos sean correctos
1115if len (argv ) < 2 or len (argv ) > 3 :
1216 print (f"\n \n Usage: { argv [0 ]} [path/to/file.bf] [args]\n " )
@@ -59,21 +63,6 @@ def checkErrors(source, argv):
5963 print (f"\n Code returned { err } ." )
6064 exit (err )
6165
62- # Calcula el numero necesario de celdas
63- # para que el programa funcione correctamente
64- # usando el minimo numero de recursos.
65- def getCells (source ):
66- num = cells = 0
67- for i in source :
68- if i == ">" :
69- num += 1
70- elif i == "<" :
71- num -= 1
72- if num > cells :
73- cells = num
74- return cells
75-
76-
7766# Obtiene el input y se lo mete a 'stdin'
7867if len (argv ) == 3 :
7968 stdin = argv [2 ]
@@ -93,7 +82,7 @@ def getCells(source):
9382# Le agrega el numero necesario de celdas necesarias + 2,
9483# para situaciones inesperadas
9584cells = []
96- for i in range (getCells ( source ) + 2 ):
85+ for i in range (LEN ):
9786 cells .append (0 )
9887
9988# Interpretador.
You can’t perform that action at this time.
0 commit comments