Skip to main content

MicroMouse

<time datetime="2023-05-25 15:01:05 &#43;0530 IST">25 May 2023</time><span class="px-2 text-primary-500">&middot;</span><span>312 words</span><span class="px-2 text-primary-500">&middot;</span><span title="Reading time">2 mins</span><span class="px-2 text-primary-500">&middot;</span> <span class="mb-[2px]"> <a href="#/blog/MicroMouse.md" class="text-lg hover:text-primary-500" rel="noopener noreferrer" target="_blank" title="Edit content" ><span class="relative inline-block align-text-bottom px-1 icon"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M490.3 40.4C512.2 62.27 512.2 97.73 490.3 119.6L460.3 149.7L362.3 51.72L392.4 21.66C414.3-.2135 449.7-.2135 471.6 21.66L490.3 40.4zM172.4 241.7L339.7 74.34L437.7 172.3L270.3 339.6C264.2 345.8 256.7 350.4 248.4 353.2L159.6 382.8C150.1 385.6 141.5 383.4 135 376.1C128.6 370.5 126.4 361 129.2 352.4L158.8 263.6C161.6 255.3 166.2 247.8 172.4 241.7V241.7zM192 63.1C209.7 63.1 224 78.33 224 95.1C224 113.7 209.7 127.1 192 127.1H96C78.33 127.1 64 142.3 64 159.1V416C64 433.7 78.33 448 96 448H352C369.7 448 384 433.7 384 416V319.1C384 302.3 398.3 287.1 416 287.1C433.7 287.1 448 302.3 448 319.1V416C448 469 405 512 352 512H96C42.98 512 0 469 0 416V159.1C0 106.1 42.98 63.1 96 63.1H192z"/></svg> </span></a > </span>

MicroMouse #

Context #

So I saw this awesome video on Veritasium’s channel today and was totally fascinated by the different techniques used by the MicroMouse competition winners to make you solve this simple yet awesome problem. It got me thinking, can I implement this game in a language I’m not that good in, c++?.

The Game #

The Game is as follows:

  • You have an unknown maze that is revealed at the start
  • You cannot have any device other than the mouse, no Iot allowed.
  • You have some time beforehand for the mouse to calibrate and look at the maze
  • Then it has to solve the maze and go as quickly as possible to the finish point

Awesome Solutions #

  1. Using the Flood fill algorithm to find the quickest path ASAP.
  2. Having the ability to move across corners with diagonals so as to skip the turning motion time.
  3. Making the mouse as smoothly as possible towards the goal.

What I’m gonna do #

I have decided to make a maze generator and an api for it to be accessed by a file. This file will have the mouse class, and info provided by the api will be its inputs, and hence the mouse will have to solve the maze.

Steps #

  1. Make a maze generator
  2. Give the mouse a way to receive suitable inputs from the mouse (like gym)
  3. Give the mouse feedback if it hit a wall or stuff

Commits #

Lets Try to do this. #