🚀 Launch Week Day 4:Introducing the Alert Details Page: A Better Way to Explore Alerts.Learn More →
Socket
Book a DemoInstallSign in
Socket

laptudirm.com/x/wreck

Package Overview
Dependencies
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laptudirm.com/x/wreck

Go Modules
Version
v0.1.0
Version published
Created
Source

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

git clone https://github.com/raklaptudirm/wreck.git
cd wreck
go build ./cmd/wreck
./wreck # put this executable in your path

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.

FAQs

Package last updated on 30 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts