Skip to content

Question re Battleship game in Ch. 8: why functions are not part of our objects?  #16

Open
@mashablair

Description

@mashablair

I have a question about this Battleship code in Chapter 8. We have the model, view, controller objects; however, some functions, like helper function parseGuess() and handler functions, like handleKeyPress are not a part of the objects.

For example, why couldn't we make the parseGuess() function a method of controller object? And is init function always a stand-alone function because it needs to start everything?

Thank you so much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions