Code Monkey home page Code Monkey logo

csci338_tilegame's Introduction

CSCI338_TileGame

The 8- tile puzzle consists of an area divided into a 3x3 grid. On each grid square is a tile, expect for one square which remains empty (blank). Thus, there are eight tiles in the 8-puzzle. A tile that is next to the blank square can be moved into the empty space, leaving its previous position empty in turn. Tiles are numbered, 1 thru 8 for the 8-puzzle, so that each tile can be uniquely identified. The aim of the puzzle is to achieve a given configuration of tiles from a given (different) configuration by sliding the individual tiles around the grid as described above.

Link to the report

https://livecsbsju-my.sharepoint.com/:w:/g/personal/mnguyen001_csbsju_edu/EdSKIQPAE8lBmS_CuMFhLNwB8lV93gxw3sFQKIn0AaEtrw?e=tC0NJ7

Step to download the code in terminal

git init 
git clone https://github.com/annanguyen99/CSCI338_TileGame 
git pull origin master

Step to run TileGame

python3 TileGame.py testinput.txt

Step to run TileGamen in verbose mode

python3 TileGame.py -v testinput.txt

TODO LIST

  • Develop a way to store the state of the 8-tile puzzle. This will be your state description.
  • Develop a node data structure. In the node you will store the current state of the 8-tile puzzle, a reference to the parent node, the move that led to the current state (did the blank move Up, Right, Down, Left), and the depth. For one of the searches, you will need to store the evaluation of the heuristic and the cost. You should only have one node data structure.
  • Develop a set of rules for generating children (successor states). When developing your children, make sure that they are expanded in clockwise order (blank moves U, R, D, L) when those moves are allowed from the parent state regardless of the search strategy.
  • Implement the breadth-first algorithm to solve the 8-tile puzzle allowing repeated states. To avoid problems of tractability, set the maximum depth that can be opened by your search to 10; the root starts at depth of zero. Your program will print-out the sequence of moves needed to solve the puzzle (go from start to finish). It will print out how many nodes were expanded and how many nodes were left on the fringe, and the maximum nodes stored in memory.
  • Implement verbose mode. In verbose mode list all the nodes that were expanded in the order they were expanded until the goal is found or until you hit the limit of your search depth. This is required and it will help you debug your other searches.
  • Implement the breadth-first algorithm to solve the 8-tile puzzle avoiding repeated states. To avoid problems of tractability, set the maximum depth that can be opened by your search to 10. Your program will print-out the sequence of moves needed to solve the puzzle (go from start to finish). It will print out how many nodes were expanded and how many nodes were left on the fringe, and the maximum nodes stored in memory.
  • Implement depth-limited search algorithm allowing repeated states (maximum depth 10) by making a small modification to your breadth-first algorithm (remember how you should alter how you add your children, so you expand them in the needed, clockwise order). Your program will print-out the sequence of moves needed to solve the puzzle (go from start to finish). It will print out how many nodes were expanded and how many nodes were left on the fringe, and the maximum nodes stored in memory.
  • Implement a depth-limited search algorithm avoiding repeated states (maximum depth 10). Your program will print-out the sequence of moves needed to solve the puzzle (go from start to finish). It will print out how many nodes were expanded and how many nodes were left on the fringe, and the maximum nodes stored in memory.
  • Implement a simple A* search allowing repeated states. You will use the tiles out of position as your heuristic, and the depth of the node as the cost. To avoid problems of tractability, set the maximum depth that can be opened by your search to 10. Your algorithm will simply pick the best node to expand, will expand it. Your program will print-out the sequence of moves needed to solve the puzzle (go from start to finish). It will print out how many nodes were expanded and how many nodes were left on the fringe, and the maximum nodes stored in memory.

csci338_tilegame's People

Contributors

annanguyen99 avatar

Watchers

 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.