@@ -89,56 +89,56 @@ def parse(self, **kwargs):
8989 @accumulate
9090 def __add (self , acc , storage ) -> int :
9191 add = int (storage ._spaces [self ._val ])
92- acc ._value += add
92+ acc .value += add
9393
9494 @accumulate
9595 def __sub (self , acc , storage ) -> int :
9696 sub = int (storage ._spaces [self ._val ])
97- acc ._value -= sub
97+ acc .value -= sub
9898
9999 @storage
100100 def __sta (self , acc , storage ):
101- storage ._spaces [self ._val ] = acc ._value
101+ storage ._spaces [self ._val ] = acc .value
102102
103103 @storage
104104 def __lda (self , acc , storage ):
105- acc ._value = storage ._spaces [self ._val ]
105+ acc .value = storage ._spaces [self ._val ]
106106
107107 @storage
108108 def __bra (self , acc , storage ):
109109 storage ._counter = self ._val
110110
111111 @storage
112112 def __brz (self , acc , storage ):
113- if acc ._value == 0 :
113+ if acc .value == 0 :
114114 storage ._counter = self ._val
115115 else :
116116 storage ._counter += 1
117117
118118 @storage
119119 def __brp (self , acc , storage ):
120- if acc ._value > 0 :
120+ if acc .value > 0 :
121121 storage ._counter = self ._val
122122 else :
123123 storage ._counter += 1
124124
125125 @manipulate
126126 def __sft (self , acc , storage ):
127- acc ._value = str (acc ._value ).zfill (3 )
127+ acc .value = str (acc .value ).zfill (3 )
128128 self ._val = str (self ._val ).zfill (2 )
129129 # Left shift first
130130 if int (self ._val [0 ]) > 0 :
131131 shifts = int (self ._val [0 ])
132132 for _ in range (shifts ):
133- acc ._value = f"{ acc ._value } 0"
134- acc ._value = acc ._value [- 3 :]
133+ acc .value = f"{ acc .value } 0"
134+ acc .value = acc .value [- 3 :]
135135 # Right shift second
136136 if int (self ._val [1 ]) > 0 :
137137 shifts = int (self ._val [1 ])
138138 for _ in range (shifts ):
139- acc ._value = f"0{ acc ._value } "
140- acc ._value = acc ._value [0 :3 ]
141- acc ._value = int (acc ._value )
139+ acc .value = f"0{ acc .value } "
140+ acc .value = acc .value [0 :3 ]
141+ acc .value = int (acc .value )
142142
143143 @inputs
144144 def __inp (self , acc , storage , input : int = 0 ):
@@ -149,10 +149,10 @@ def __inp(self, acc, storage, input: int = 0):
149149 except :
150150 print ("Invalid input." )
151151 sys .exit (1 )
152- acc ._value = input
152+ acc .value = input
153153
154154 def __out (self , acc , storage ):
155- print (acc ._value )
155+ print (acc .value )
156156 storage ._counter += 1
157157
158158 @halt
0 commit comments