Skip to content

adityaathalye/oxo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 

Repository files navigation

justforfunnoreally.dev badge

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.

  • Follow the commit history to trace how the game logic gradually emerged.

But why?!?

For unabashed mirth and merriment, of course. Why else?

About

A game of traditional 3x3 Noughts and Crosses, in Bash.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages