Giter VIP home page Giter VIP logo

n-ything's Introduction

N-ything

Problem Description

English version

The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other; thus, a solution requires that no two queens share the same row, column, or diagonal. The eight queens puzzle is an example of the more general n queens problem of placing n non-attacking queens on an n×n chessboard, for which solutions exist for all natural numbers n with the exception of n = 2 and n = 3

Indonesia version

N-ything problem merupakan modifikasi N-queen problem. Perbedaannya, buah catur yang menjadi pertimbangan bukan hanya ratu (queen), namun juga meliputi kuda (knight), gajah (bishop), dan benteng (rook). Seperti N-queen problem, permasalahan dari N-ything problem adalah mencari susunan buah-buah catur pada papan catur berukuran 8x8 dengan jumlah buah catur yang menyerang buah catur lain minimum.

Secara lebih formal, cari susunan buah-buah catur sehingga jumlah pasangan terurut (p, q) di mana p menyerang q minimum. Perhatikan bahwa bila p menyerang q, belum tentu q juga menyerang p. Perhatikan juga bahwa (p, q) dan (q, p) dianggap sebagai dua pasangan yang berbeda.

Adapun sifat penyerangan ini mengikuti sifat penyerangan pada permainan catur pada umumnya. Misalnya, sebuah benteng dapat menyerang buah catur lain yang berada pada jalur vertikal/horizontal apabila buah catur tersebut tidak terhalang oleh buah catur lainnya, dan seterusnya.

Untuk menyelesaikan N-ything problem ini, Anda diminta menggunakan ketiga algoritma local search berikut:

  1. Hill climbing
  2. Simulated annealing
  3. Genetic algorithm

Requirements

  • Python2

How to run app?

  1. Run the program with the following command.
     python main.py
  2. Input the filename, you can choose one of test file from this repository.
  3. Choose the algorithm strategy to find the solution.
  4. Choose max attempt.
  5. The Board will printing immediately after found the solution.

Screenshots

App .gif #1 Figure 1 - App preview

App Screenshot #2 Figure 2 - App screenshot

n-ything's People

Contributors

ivanj26 avatar kevinbasuki avatar malfianrasyidin avatar mastertech98 avatar priagungs avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.