BridgesUNCC / bridges-python

Python client library for Bridges
http://bridgesuncc.github.io
MIT License
3 stars 4 forks source link

Games constructor requires cols & rows in reverse order when it shouldn't #73

Open KyleReto opened 4 years ago

KyleReto commented 4 years ago

The python bridges library is inconsistent with the other versions. When creating a game off of NonBlockingGame (and maybe BlockingGame, I haven't tried), the other language libraries require (cols, rows), but the python version requires (rows, cols).

The documentation doesn't list the parameters correctly, so it's probably just a bug in the code, nowhere else.

krs-world commented 4 years ago

I looked at the 3 clients.. the game grid and its parent, grid accept arguments rows, cols. There was some incorrect labeling of the functions, perhaps.. from what I can tell.

On the SpaceInvaders solutions, you should pass the size as. rows followed by columns. The applications works fine in Java and C++ (though I am a poor player to test it, but there were no errors). The python version I fixed the size issues, but issues come from addressing the grid elements -- I suspect you are calling the row, col indices in the opposite order. Check it out.

Also test the Java and C++ version. My modifications were mainly in the assignment, not the client.

krs-world commented 4 years ago

grid should be addressed with grid[i][j], where i is the row, j is the column.

krs-world commented 4 years ago

I have fixed the python client for this issue - Kyle, check it out. I pushed the client to git, so you need to point to that version to test your code. I ran the input_game example and was able to change the rows, columns and now it does the right thing.. The public versions will need updating at some point..