GithubHelp home page GithubHelp logo

tiralab's Introduction

tiralab's People

Contributors

jojoensuu avatar

Watchers

 avatar

tiralab's Issues

Vertaisarviointi

Projekti ladattu tiistaina 28.11 klo 21:02

Huomasin peliä pelatessani, että tekoäly ei huomaa yhden siirron päässä olevaa pelaajan voittoa. Jos pelajaa lähtee esimerkiksi lisäämään rakseja allekkain vasemmasta yläkulmasta, tekoäly lähtee lisäämään ympyröitä riviin, ja lopulta tekoäly jatkaa omaa riviään, vaikka pelaajalla on jo neljän pituinen suora sarakkeessa.

Tämän voi korjata esimerkiksi vaihtamalla funktiossa selectBestMove minimax-funktiokutsussa maximizingplayerin truesta falseksi:

let score = minimax(board, 0, false, move.rowIndex, move.colIndex, AI);

Muuten projekti näyttää hyvältä, esimerkiksi luokat on jaettu siististi oikeisiin hakemistoihin. Minimax-funktiossa on kätevää iteroida suoraan matriisin alkiot läpi, mahdollisten siirtojen generoinnin sijaan. Funktiossa voiton tarkistuksen tulisi myös olla ylimpänä, mutta jostain syystä funktio silti toimii oikein (aiemmin mainitun muutoksen jälkeen)

Vertaisarviointi #2

I downloaded the project as a zip file on 5 Dec at 2:30 pm. I reviewed the project through documentation and source code and through running the program.

The program is a 5x5 Tic Tac Toe for a single player playing against AI.

The project structure is logical and the names of the classes and functions are easy to understand. The classes in the components folder are responsible for the UI while the classes in the logic folder are responsible for the logic of the gameplay itself and are called by the UI. In addition there are some helper functions that help the AI functions. The code is written in an easy-to-follow fashion and variables are intuitively named; however, some in-code comments might improve readability further. I will admit that I despite trying I did not fully understand how the algorithm works because my project is very different; however I will try to give good suggestions for improvement.

The tests seem to test the different features in a logical manner and they pass. Some code lines are not covered by the tests but due to the nature of the project they may be more conveniently covered by manual testing.

The game board is visually nice and simple and the gameplay is intuitive. The board is not 5x5 as specified in the technical specs, but the gameplay works even with the larger board. The game correctly identifies the winning situation, notifying who has won and prohibiting any further moves.

Suggestions for improvement:

  • The AI moves become quite slow as the game progresses. Maybe there is room for improvement in algorithm efficiency.
  • It is quite simple to win the AI by creating a situation where there is a free-standing row of four X:s after which there are two possible winning moves for the player; the AI does not attempt to stop this situation from developing. Maybe this is unavoidable due to the algorithmic depth.
  • I did also find some game situations where the AI would have had an immediate winning move for a diagonal win but did not use it. Is it possible for the algorithm to always first check whether an immediate win is possible?
  • Notification of gameplay end and the winner could be more pronounced, maybe even a pop-up window.
  • For the final application it might be nice to have some short instructions for gameplay in-game.

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.