Code Monkey home page Code Monkey logo

micromouse-maze's Introduction

micromouse-maze

Project for developing and testing code used for manipulating mazes used in the micromouse contest.

The library code is also available on its own at: https://github.com/micromouseonline/libMaze

Find out more about the micromouse contest at: http://www.micromouseonline.com

This project is configured for gitflow. Development is through branches from develop.

This version of the code was used in the CLion IDE and uses cmake for builds. If CLion and CMake are not your thing, there is a Netbeans project as well. Both should build and be able to run the tests.

The googletest target tests individual libMaze functions

The libMaze_run target runs against a list of maze fies supplied on the command line. For each file, it will simulate a search by the mouse out to the gal and back to the start. After the searches the quality of the solution is evaluated. Mazes which are fully solved are flagged. Mazes that are close to fully solved are flagged and printed out for visual inspection. These are the 'take a chance' mazes that it may be worth the mouse performing a speedrun to get a good score under non-Japan rules. At the end of the listthe total number mazes, the number of solved mazes and the number of 'take a chance' mazes will be displayed.

Git

This project uses git submodules for library stuff - the liMaze and mazefiles content for example.

If you are not familiar with git, you might find cloning the repo a bit annoying if the submodules do not arrive with the main repo. The CLion project files are part of the repository.

To clone by hand, including the submodules:

git clone --recurse-submodules https://github.com/micromouseonline/micromouse-maze.git

If you forgot the submodules bit, you can can still get them like this.

git clone https://github.com/micromouseonline/micromouse-maze.git
cd micromouse-maze
git submodule init
git submodule update

CMake

The build system here is CMake. To build the code, first create a folder for the build artefacts. Then change to that folder and run cmake, followed by make:

mkdir cmake-build-debug
cd cmake-build-debug
cmake ..
make

You will probably want to add the build folder to .gitignore.

Assuming the build works out, the tests can be run from the build folder with

./tests/test_suite/runTestSuite

The main program can be run with commands like:

./libmaze_run ../tests/mazes/japan2007ef_classic.maz    

Data standards:

Basic integral types should be as defined in <stdint.h> to ensure widths and ranges across platforms. e.g. uint16_t for an unsigned 16 bit integer

Coding standards:

In a perfect world, the sources would comply with a well known style guide like this one:

https://google.github.io/styleguide/cppguide.html

but that seems unlikely for now :)

Testing:

The project includes the GoogleTest framework for unit tests. These are set up to run easily under Netbeans but should be easy enough to configure for other IDEs. All the testing code is in the folder tests. The googletest framework code is in the folder gtest.

micromouse-maze's People

Contributors

micromouseonline avatar peque avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

peque rodb70

micromouse-maze's Issues

Missing `astyle` style

When compiling the project, astyle is executed. Could a configuration file with the style options be missing?

When I execute it in my computer, all source code files get modified, so I guess the default in my system/version is different from yours.

Maybe adding a configuration file or a --style=xxx option to the command would help.

Note that the astyle command is both in CMakeLists.txt and tests/test_suite/CMakeLists.txt. Is that intentional?

Question: mazes repository?

I see there are lots of maze files in this project, which is great. I wonder if you ever considered creating a separate project just for storing maze files. Bet many micromouse enthusiasts could benefit from it and maybe contribute.

I would be happy to contribute the few mazes I have:

https://github.com/Theseus/maze-simulator/tree/master/mazes

I think a plain-text format is the best (easy to visualize with any editor or with the browser and easy to work with it using a version control system like Git). But would be willing to adopt your preferred format. 😉

If you think it could be a good idea but do not want to spend time with it I will be happy to do it. Only, I want to make sure at least someone likes the idea and agree with the file format (the idea would be to actually use the project and avoid duplication...).

PS: if you really want to keep this projects just like an off-site backup and do not deal with this issues, I will stop bothering you. 😇

Missing documentation

I am able to compile the project, but not sure about how to use it nor for what it could be used for. 😅

Simply trying to execute ./libmaze_run will fail. If I pass a .maz file as first parameter I get a segmentation fault (core dumped).

Looking at the CMake file it seems libmaze_runX is actually no different, is it? Is there an actual graphical interface implemented?

Adding a brief description to the README file would be great. 😇

Anyway, thanks a lot for sharing this! 😄

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.