Skip to main content
edited tags
Link
200_success
  • 145.7k
  • 22
  • 191
  • 481
added 6 characters in body; edited tags; edited title
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

python: design of Designing a simple Battleship game in Python

EDIT:EDIT: GamePlan should be probably called Board as answer of Janne Karila suggests. Just to clarify what I meant by that name with my flawed English.

  1. Is it correct that GamePlan processes shooting (in the method hit)?

  2. Is hit a good name for that method or should it be something like process_hit? Because GamePlan is being hit, it is not hitting anything. Is hit still good in such case? This is probably my biggest concern.

  3. Should ships be represented as objects of a class ShipShip instead?

  4. Is GamePlan a good thing to have or is it useless? I mean I could make class AI that directly owns ships but I am not sure where stuff like SHIP_COUNTS would go then. I have also planned that I will use GamePlan to generate ship positions (hence SHIP_COUNTS and DIMX, DIMY which are unused atm) but plan generation could also easily go to AI, I guess.

  5. Is there anything else that is wrong?

python: design of a simple game

EDIT: GamePlan should be probably called Board as answer of Janne Karila suggests. Just to clarify what I meant by that name with my flawed English.

  1. Is it correct that GamePlan processes shooting (in the method hit)?

  2. Is hit a good name for that method or should it be something like process_hit? Because GamePlan is being hit, it is not hitting anything. Is hit still good in such case? This is probably my biggest concern.

  3. Should ships be represented as objects of a class Ship instead?

  4. Is GamePlan a good thing to have or is it useless? I mean I could make class AI that directly owns ships but I am not sure where stuff like SHIP_COUNTS would go then. I have also planned that I will use GamePlan to generate ship positions (hence SHIP_COUNTS and DIMX, DIMY which are unused atm) but plan generation could also easily go to AI, I guess.

  5. Is there anything else that is wrong?

Designing a simple Battleship game in Python

EDIT: GamePlan should be probably called Board as answer of Janne Karila suggests. Just to clarify what I meant by that name with my flawed English.

  1. Is it correct that GamePlan processes shooting (in the method hit)?

  2. Is hit a good name for that method or should it be something like process_hit? Because GamePlan is being hit, it is not hitting anything. Is hit still good in such case? This is probably my biggest concern.

  3. Should ships be represented as objects of a class Ship instead?

  4. Is GamePlan a good thing to have or is it useless? I mean I could make class AI that directly owns ships but I am not sure where stuff like SHIP_COUNTS would go then. I have also planned that I will use GamePlan to generate ship positions (hence SHIP_COUNTS and DIMX, DIMY which are unused atm) but plan generation could also easily go to AI, I guess.

  5. Is there anything else that is wrong?

Tweeted twitter.com/#!/StackCodeReview/status/327966831392456705
added 156 characters in body
Source Link
clime
  • 241
  • 2
  • 9

EDIT: GamePlan should be probably called Board as answer of Janne Karila suggests. Just to clarify what I meant by that name with my flawed English.

There are a few things I am unsure about:

There are a few things I am unsure about:

EDIT: GamePlan should be probably called Board as answer of Janne Karila suggests. Just to clarify what I meant by that name with my flawed English.

There are a few things I am unsure about:

added 11 characters in body
Source Link
clime
  • 241
  • 2
  • 9
Loading
added 9 characters in body
Source Link
clime
  • 241
  • 2
  • 9
Loading
deleted 5 characters in body
Source Link
clime
  • 241
  • 2
  • 9
Loading
added 46 characters in body
Source Link
clime
  • 241
  • 2
  • 9
Loading
added 46 characters in body
Source Link
clime
  • 241
  • 2
  • 9
Loading
Source Link
clime
  • 241
  • 2
  • 9
Loading