Giter Club home page Giter Club logo

prolog-game-solving's Introduction

Simple Game Solving with Prolog

Through AND/OR game exploration.

Prerequisites

SWI-Prolog version 8.4.2

How to play

To run the included example simply run:

swipl main.pl

This will launch an m-n-k game (4-3-3). This specific game instance is a bit slow, it may require some seconds to make the first move (first move is for the AI). From the second one on, speed improves rapidly.

When requested, input shall be given in the form: X-Y. (notice the final dot). Such a move would place a stone at column X and row Y.

To quit the game, input quit..

How to change game

Nim game is also included in this repo. To play it, simply replace main.pl and game.pl with the ones in the nim/ folder.

Moves have similar format: H-N. where H is the heap index, N is the number of coins to remove.

More games can be added by developing a custom game module.

Feeling bored?

If you don't want to think your moves, you can play a legal move automatically by inputting a capital capital letter as input (will be interpreted as a Prolog variable and automatically unified with a legal move).

Eg. A.

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.