guyver2 / battlechess

Chess with Battleship modification. You can only see around your pieces.
3 stars 4 forks source link

Castelable is not implemented #20

Closed guyver2 closed 3 years ago

guyver2 commented 3 years ago

Starting a new game and requesting the possible moves for the king returns an error

INFO:     194.230.158.218:49692 - "GET /games/hxjktq/moves/e1 HTTP/1.1" 500 Internal Server Error
2021-05-22 17:18:03,818 INFO sqlalchemy.engine.Engine ROLLBACK
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/uvicorn/protocols/http/h11_impl.py", line 396, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "/usr/local/lib/python3.6/site-packages/uvicorn/middleware/proxy_headers.py", line 45, in __call__
    return await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/fastapi/applications.py", line 199, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/applications.py", line 111, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 181, in __call__
    raise exc from None
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/cors.py", line 86, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/usr/local/lib/python3.6/site-packages/starlette/middleware/cors.py", line 142, in simple_response
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 82, in __call__
    raise exc from None
  File "/usr/local/lib/python3.6/site-packages/starlette/exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 566, in __call__
    await route.handle(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 227, in handle
    await self.app(scope, receive, send)
  File "/usr/local/lib/python3.6/site-packages/starlette/routing.py", line 41, in app
    response = await func(request)
  File "/usr/local/lib/python3.6/site-packages/fastapi/routing.py", line 202, in app
    dependant=dependant, values=values, is_coroutine=is_coroutine
  File "/usr/local/lib/python3.6/site-packages/fastapi/routing.py", line 150, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
  File "/usr/local/lib/python3.6/site-packages/starlette/concurrency.py", line 34, in run_in_threadpool
    return await loop.run_in_executor(None, func, *args)
  File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "./server/btchApi.py", line 355, in get_moves
    moves = snap.getPossibleMoves(square, color)
  File "./server/models.py", line 228, in getPossibleMoves
    ijmoves = board.possibleMoves(color, i, j)
  File "./core/btchBoard.py", line 211, in possibleMoves
    moves = list(self.kingMoves(color, i, j))
  File "./core/btchBoard.py", line 270, in kingMoves
    if k in self.castelable:
AttributeError: 'BtchBoard' object has no attribute 'castelable'
quimnuss commented 3 years ago

Typo, castelable - > castleable

Is there a github action for code coverage?

El ds., 22 de maig 2021, 17:20, Antoine Letouzey @.***> va escriure:

Assigned #20 https://github.com/guyver2/battlechess/issues/20 to @quimnuss https://github.com/quimnuss.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/guyver2/battlechess/issues/20#event-4782445572, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA74OCJK4SG7R6E46L5ZIRLTO7DVFANCNFSM45KXSV6A .