You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to add in the map_array[][] using the code that worked for Space Invaders, but when I touch map_array in bot code, I get the following errors:
Traceback (most recent call last):
File "/home/pedro/src/CYLGame/CYLGame/Server.py", line 242, in sim
gtoken = runner.run(room, playback=True).save(self.gamedb)
File "/home/pedro/src/CYLGame/CYLGame/Game.py", line 308, in run
player.run_turn(game.random)
File "/home/pedro/src/CYLGame/CYLGame/Player.py", line 55, in run_turn
nxt_state = self.prog.run(self.get_state(), max_op_count=max_ops, random=random)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 279, in run
self.handle(self.ast, sym_tbl)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 267, in handle
return handler(node, sym_tbl)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 188, in handle_block
self.handle(child, sym_tbl)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 267, in handle
return handler(node, sym_tbl)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 183, in handle_assign
sym_tbl[node.left.value] = self.handle(node.right, sym_tbl)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 267, in handle
return handler(node, sym_tbl)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 219, in handle_getarrayitem
var = self.handle(node.left, sym_tbl)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 267, in handle
return handler(node, sym_tbl)
File "/home/pedro/.local/share/virtualenvs/pac-bot-CuEVk7J3/lib/python3.6/site-packages/littlepython/interpreter.py", line 220, in handle_getarrayitem
return var[self.handle(node.right, sym_tbl)]
TypeError: 'int' object is not subscriptable
The text was updated successfully, but these errors were encountered:
I updated the code to use ConstMapping like Space Invaders does.
I did this in the process of trying to solve Issue #37, which is that when I touch map_array[][] in an LP program it crashes with the errors quoted in #37. As far as I can tell, I am creating and providing the map to users in bot_vars exactly the same way I do with Space Invaders.
I have punted this issue for now -- I just removed map_array from the code (commented it out) and removed it from the documentation. The game should be playable without the map.
I tried to add in the map_array[][] using the code that worked for Space Invaders, but when I touch map_array in bot code, I get the following errors:
The text was updated successfully, but these errors were encountered: