Skip to content

telwell/knights_travails

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

assignment_search

Marco? Polo!

A data structures and algorithms Ruby challenge from the Viking Code School

Created by Ser Trevor Elwell

##Instructions:

  1. Make a new MoveTree: example = a = Move.Tree.new([5,5],5) This will create a MoveTree starting at the center square with a depth of 5.

  2. Make a new KnightSearcher: example = s = KnightSearcher.new(a.head) Creates a new knight searcher and pass it the head from the MoveTree already created

  3. Search for a square: You can use the :bfs_for() or :dfs_for() methods to search via breadth-first or depth-first traversals respectively. s.bfs_for([3,3]) or s.dfs_for([3,3])

  4. Look at the benchmarking function: You can see the different average times it takes to run breadth-first vs. depth first. Takes an iterations paramter. example = s.benchmark(5000) will run bfs and dfs 5000 times and put the average time and average moves to the console.

About

Marco? Polo!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%