Git Product home page Git Product logo

knights-walk's Introduction

The Knight's Walk

Horsey make ellll shape!

Finding complete knights' paths on different sized chessboards using C++.

Installation

I am still learning CMAKE, so for the time being, please build this using Visual Studio 2019.

  1. Download this repository and unzip it. The root folder will be the folder with -main appended to the repository name.
  2. Optional: You could delete the img folder, .gitattributes, .gitignore, and README.md if wanted.
  3. Open Visual Studio 2019 and select Continue without code → under the opening project options.
  4. Navigate to the Menu. FileNewProject from existing code. Select the Visual C++ option.
  5. For Project file location:, select the root folder you downloaded.
  6. For Project name:, name the project whatever you want. Select Next.
  7. Select Use Visual Studio, and leave all settings. Select *Next.
  8. We will be including include and library paths later. Select Finish.
  9. Navigate to the Solution Explorer on the left and open the main.cpp file located in src.
  10. Navigate to the Menu. Project[NAME HERE] Properties.
  11. Change the Configuration tab to All Configurations
  12. Under the C/C++ tab add the following lines to the Additional Include Directories section by clicking on the three dots at the end of the selection: $(SolutionDir)include, $(SolutionDir)lib\SFML\include.
  13. Under the Linker tab, navigate to the General sub tab. Add the following line to the Additional Library Dependencies section by clicking on the three dots at the end of the selection: $(SolutionDir)lib\SFML\lib.
  14. Navigate to the Input sub tab within Linker and add the following dependencies to Additional Dependencies: sfml-graphics.lib, sfml-window.lib, sfml-audio.lib, sfml-system.lib, sfml-network.lib.
  15. Optional: If you're going to be debugging and changing this code, change the Configuration tab to Debug and change the additional dependencies so they have a -d prefix before .lib. An example would be: sfml-graphics-d.lib.
  16. Switch back to All Configurations in the Configuration tab and navigate back to general project properties.
  17. Under the General properties subtab, change the output directory to: $(SolutionDir)build\$(Configuration).
  18. Under the General properties subtab, change the intermediate directory to: $(SolutionDir)build\Intermediate
  19. Build the project once by right-clicking on the project and selecting Build.
  20. You should get an error, but you will get an .exe in the specified build folder.
  21. We need the .dll files from the SFML library. Download the library here.
  22. Unzip and navigate to the bin folder.
  23. Copy all the .dll files and paste them in the same folder where the project .exe is.
  24. Rebuild one more time.
  25. Exectuable will be located in build/Debug or build/Release depending on which build type you used in Visual Studio.

How to use?

  1. Navigate to the main.cpp file.
  2. Navigate to the int main() entry point.
  3. Change the amount of rows and collumns with the variables cols and rows.
  4. Navigate to the declaration of a Knight.
  5. Change it's position from (0,0) to something else by altering the numbers in Knight knight{0,0};.
  6. Build and run the executable.

More Pictures

knights-walk's People

Contributors

kacperbazan avatar

Stargazers

Mohammed Ebrahim 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.