Coder Social home page Coder Social logo

four-in-row-in-javase's Introduction

=====================
four-in-row-in-JavaSE
=====================

This project is a four in row game that has been written in Java
The algorithm that I used is min-max algorithm after that I have added alpha-beta functionality to reduce the number of nodes generated.

In this project the user able to set the depth since the algorithm uses depth-first search.

choosing depth to be 7 is the best in terms of memory performance.



///////////////////////
program running
///////////////////////


0: you play first, 1 computer play first: 1
enter max depth: 7
|               |
|               |
|               |
|               |
|               |
|               |
  - - - - - - -
  0 1 2 3 4 5 6

computer is thinking ...
computer played: 3
Created Nodes: 264415
took(0.454s)
|               |
|               |
|               |
|               |
|               |
|       O       |
  - - - - - - -
  0 1 2 3 4 5 6

your turn, type a column number: 3
|               |
|               |
|               |
|               |
|       X       |
|       O       |
  - - - - - - -
  0 1 2 3 4 5 6

computer is thinking ...
computer played: 2
Created Nodes: 318429
took(0.393s)
|               |
|               |
|               |
|               |
|       X       |
|     O O       |
  - - - - - - -
  0 1 2 3 4 5 6

your turn, type a column number: 4
|               |
|               |
|               |
|               |
|       X       |
|     O O X     |
  - - - - - - -
  0 1 2 3 4 5 6

computer is thinking ...
computer played: 1
Created Nodes: 473208
took(0.367s)
|               |
|               |
|               |
|               |
|       X       |
|   O O O X     |
  - - - - - - -
  0 1 2 3 4 5 6

your turn, type a column number: 0
|               |
|               |
|               |
|               |
|       X       |
| X O O O X     |
  - - - - - - -
  0 1 2 3 4 5 6

computer is thinking ...
computer played: 3
Created Nodes: 368927
took(0.359s)
|               |
|               |
|               |
|       O       |
|       X       |
| X O O O X     |
  - - - - - - -
  0 1 2 3 4 5 6
  
  
  
  ...

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.