Proof of concept site: battleship.calvin.sg
This project uses MVC framework within its Javascript code, separating the logic and presentation layer behind Battleship web app into 3 logical components:
Model
- Contains game logic and data.
- Keeps state of game, contains logic relates to state changes.
View:
- Presents data to user and handles user interaction.
- Keep display up to date with messages, hits and misses
Controller:
- Interface between Model and View components.
- Keeps tracks of user's guess, progress, user input and brings to model
Self-directed learning on Head First JavaScript programming, with my own understanding illustrated in comprehensive notes/comments along the javascript code.
Media assets, Javascript, HTML, CSS codes are adapted from the physical book and website.
Hosted here on GitHub pages, no WordPress or Jekyll template required!
- Freeman, E. and Robson, E., 2014. Head First JavaScript programming. 1st ed. Sebastopol, California, United States of America: O'Reilly Media, Inc, pp.317 - 380 (Chapter 8: Building an app, Bring it all together).
- Freeman, E. and Robson, E., n.d. Head First JavaScript Programming. [online] Wickedlysmart.com. Available at: https://www.wickedlysmart.com/hfjs/ [Accessed 5 June 2021].