Skip to content

A simple Tic-Tac-Toe game that runs on the terminal command line, with a human playing agains the program.

Notifications You must be signed in to change notification settings

practicalli/tictactoe-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tictactoe-cli

TicTacToe game written in Clojure, running on the command line with keyboard input for each player (no AI for a computer player yet).

This project is from theTicTacToe game from Practicalli Clojure (work in progress)

Usage

The current game solution has not been written using TDD, so is put on a branch called solution-no-tests.

To use the current version of the game, checkout this branch first

git checkout solution-no-tests

Playing the game via the command line

The game can be played in the command line by starting a REPL from the root of the project (where project.clj file is)

lein repl

Once the repl prompt is displayed, start the game by including the game namespace

(require 'tictactoe-cli.core)

The current game board will be displayed, followed by a prompt for the next move. Each time a move is made, the new game board will be displayed, along with a prompt for the next move.

Playing the game in Spacemacs/Emacs

You can play the game in Spacemacs / Emacs too, using the mini-buffer as the command line prompt (Stdin).

Start the REPL using cider-jack-in (, ') and open the REPL buffer (, s s).

Change the REPL to the tictactoe-cli.core namespace, (, s n).

Evaluate the buffer to start the game, (, e b).

Enter the next move value in the mini-buffer (not the REPL window) when you see the Stdin prompt.

License

Copyright © 2018 Practicalli

Distributed under the Creative Commons Attribution Share-Alike 4.0 International.

About

A simple Tic-Tac-Toe game that runs on the terminal command line, with a human playing agains the program.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages