Coder Social home page Coder Social logo

shakkialy's Introduction

Shakkialy

Ohjelma toteuttaa yksinkertaisen shakki tekoälyn. Tekoälyä vastaan voi pelata yksinkertaisen käyttöliittymän avulla, joka on toteutettu komentorivillä.

Käyttöohje

Luokalla "Play.java" voi pelata yksinkertaisessa käyttöliittymässä tietokonetta vastaan. Luokalla "ComputerVsComputer.java" voi katsoa kun algoritmi pelaa itseään vastaan.

Minimax

Toteutukseen käytetään minimax-algoritmia, jossa algoritmi hakee rekursiivisesti siirtoja luokitellen niiden arvon käyttäen nappuloiden arvoja (esim. hevonen = 3, sotilas = 1, … .) Sen toteutukseen tarvitsemma hakupuun tietorakenteeksi. Maksimoimme ja minimoimme vuorotellen siirtojen tuottaman arvon riippuen onko valkoisen vai mustan vuoro.

https://en.wikipedia.org/wiki/Minimax

Alpha-beta pruning

Prosessin avulla voimme minimoida haarojen lukumäärän. Jätämme käymättä kohdat, joissa löydämme siirron, joka tuottaa pienemmän arvon kuin jokin aiemmin löytämämme siirto.

https://en.wikipedia.org/wiki/Alpha–beta_pruning

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.