Skip to content

XAJX179/Knight-Travails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Table of contents

Knight Travails

On a 8x8 chess board the knight starts at one place and finds shortest path to another. The vertices in the graph are each of the possible positions on the chessboard, represented by a pair of coordinates like [x, y], where x and y are between 0 and 7, x coord first in the array. The edges are the valid knight moves between vertices.


πŸ“¦ Structure

β”œβ”€β”€ lib
β”‚Β Β  β”œβ”€β”€ knight_travails
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ board.rb
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ display.rb
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ game.rb
β”‚Β Β  β”‚Β Β  └── knight.rb
β”‚Β Β  └── knight_travails.rb
β”œβ”€β”€ main.rb // just a file for testing.
└── README.md

πŸ›  Features

  • knight_moves(start,stop) - returns the shortest path from start to stop for the kngiht and outputs a nice display of board to showcase it.

🫣 Peek

image of output of the program


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages