Skip to content

Commit

Permalink
fix: improved data structure representation for maze
Browse files Browse the repository at this point in the history
  • Loading branch information
tolstenko committed Sep 28, 2024
1 parent 3ccdd7f commit 6200ded
Show file tree
Hide file tree
Showing 5 changed files with 285 additions and 192 deletions.
191 changes: 0 additions & 191 deletions docs/artificialintelligence/assignments/flocking/flocking.cpp

This file was deleted.

6 changes: 5 additions & 1 deletion docs/artificialintelligence/assignments/maze/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ In order to be consistent with all languages and random functions the pseudo ran

Every call to the random function should return the current number the index is pointing to, and then increment the index. If the index is greater than 99, it should be reset to 0.

## Direction decision making
## Direction decision-making

In order to give consistency on how to decide the direction of the next cell, the following procedure should be followed:

Expand All @@ -41,6 +41,10 @@ In order to give consistency on how to decide the direction of the next cell, th
3. If there is one visitable, do not call random, just return the first neighbor found;
4. If there are two or more visitable neighbors, call random and return the neighbor at the index of the random number modulo the number of visitable neighbors. `vec[i]%visitableCount`

!!! example "Data Structure"

Read the [Data Structure](maze-datastructure.md) page to understand how the maze could be represented in memory.

## Input

The input is a single line with three `32 bits` unsigned integer numbers, `C`, `L` and `I`, where `C` and `L` are the number of columns and lines of the maze, respectively, and `I` is the index of the first random number to be used> `I` can varies from `0` to `99`.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 6200ded

Please sign in to comment.