Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adityaathalye/oxo
A game of traditional 3x3 Noughts and Crosses, in Bash.
https://github.com/adityaathalye/oxo
bash bash-script functional-programming shell shell-script study study-project
Last synced: 16 days ago
JSON representation
A game of traditional 3x3 Noughts and Crosses, in Bash.
- Host: GitHub
- URL: https://github.com/adityaathalye/oxo
- Owner: adityaathalye
- Created: 2019-11-20T14:34:13.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-10T07:04:21.000Z (2 months ago)
- Last Synced: 2024-09-10T09:21:08.921Z (2 months ago)
- Topics: bash, bash-script, functional-programming, shell, shell-script, study, study-project
- Language: Shell
- Homepage:
- Size: 30.3 KB
- Stars: 8
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![justforfunnoreally.dev badge](https://img.shields.io/badge/justforfunnoreally-dev-9ff)](https://justforfunnoreally.dev)
**To play**
- Clone, cd into the root dir, and run the "main" script: `$ ./oxo`
- Your machine should have Bash 4+, preferably Bash 4.4+ (latest stable)
- Be kind to the "Computer player". It is randumb :D**To code-read**
- Board design and setup is at the beginning of `oxo_logic.sh`
- The scoring logic is based on pattern matches against a regularly-formatted board. See:
- The linchpin function `fit_board_to_square_grid`
- The commentary in the `# SCORING LOGIC` section
- The scoring functions, particularly `__all_crosses`, `__all_noughts`, `__player_wins_grid`, `crosses_win`, `noughts_win`, and `its_a_draw`- I like to write [Functional Programming style Bash](https://www.evalapply.org/tags/bash/).
- Follow the commit history to trace how the game logic gradually emerged.
**But why?!?**
For unabashed mirth and merriment, of course. Why else?