mrowan137 / connect-k

Connect a line of length k to win.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connect-k

Flask-based Python web-game, hosted with Google App Engine, called Connect-k: a 2-player game where players take turns placing pieces onto the bottom row of an infinite grid. The game ends if a player's pieces form a contiguous line (horizontal or vertical) of length k. Try it out here.

Description

Supported gameplay options:

  • Value of k: length of the line required to win
  • Player color: red or blue
  • Player to go first: red or blue
  • Opponent: computer (easy), computer (hard), human

Dependencies

Help

  • If multiple web browser tabs are open and identified as belonging to the same user, be aware that it modifies the same game data; opening, for example, another tab in the same web browser could be identified as belonging to the same user. On the other hand, accessing another game session from a new 'incognito' window could be identified as belonging to a separate user and would generate separate game data.

Useful Google Cloud App Engine commands

This application is hosted using Google App Engine (there are great tutorials for how to deploy a Flask app using App Engine, e.g. this tutorial). When working with the App Engine platform, the following are some useful gcloud commands:

  • Deploy changes to the Google App Engine server: gcloud app deploy.
  • Open the most recent app version in a web browser: gcloud app browse.
  • List all versions deployed to App Engine server: gcloud app versions list.
  • There's a limit to how many versions of the app you can store on App Engine; if you have too many you will not be able to upload more unless deleting some old ones. There is a useful script here that can remove all but the n most recent versions. With n=2, it could be called like this to delete all but the 2 most recent versions: sh delete-older-gcloud-app-versions.sh default 2. After doing this, you can deploy the most recent version of the app.

Author

Michael E. Rowan — mrowan137michael@mrowan137.dev.

License

MIT License.

References

About

Connect a line of length k to win.

License:MIT License


Languages

Language:Python 91.1%Language:CSS 4.7%Language:HTML 4.1%