Giter Club home page Giter Club logo

wreck's Introduction

The Wreck Tic-Tac-Toe Engine

Wreck is a tic-tac-toe analysis engine which is capable of perfect play, i.e, it can win any winnable, and defend any defendable position. A full game played against Wreck will either end in a draw or a win for Wreck.

Installation

go install laptudirm.com/x/wreck/cmd/wreck@latest

Usage

Main Command

wreck [position]

REPL Commands

wreck :: help            # help regarding commands and the repl
wreck :: load <position> # load this position into the engine
wreck :: play <move>     # play the provided move on the current position
wreck :: eval            # evaluate current position
wreck :: exit            # exit from program

Evaluation

Wreck evaluates position as a number. An evaluation of ±00 means the position is equal, and perfect play will result in a draw. An evaluation starting with a +, like +Wn means means player X will win in n steps, and an evaluation starting with - means player O will win in n steps.

Position Strings

A tic tac toe position is represented by a 9-character long position string which is composed of x, o, and . symbols. Each of the nine characters represents one of the cells on a tic tac toe board, and the symbols represent a mark by player X, a mark by player O, and an empty cell respectively.

Any tic-tac-toe position:
1 2 3  x o .
4 5 6  x . .
7 8 9  o . .

Is represented in the following format:
  123456789
  xo.x..o..

Moves

A move on the tic tac toe board which is at a particular position is represented by a number from 1-9, each of which represent a particular cell on the board.

wreck's People

Contributors

raklaptudirm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.