maze

module
v0.0.0-...-c47cfc5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2024 License: MIT

README

Go

maze

Консольная игра "Лабиринт"


Описание проекта

Проект представляет реализацию консольной программы для генерации лабиринта и поиска пути в нём. Программа генерирует лабиринт, алгоритм для генерации выбирается пользователем при запуске программы (алгоритм Прима или алгоритм Краскала), различного размера, размер также указывается пользователем (ширина и высота лабиринта), а также показывает поиск пути в лабиринте от точки S (начало лабиринта) к точке E (конец лабиринта) алгоритмами BFS или A*


Технологии

  • Go 1.23.0
  • DDD (Domain Driven Design)

Запуск игры

1. Клонировать репозиторий:

git clone https://github.com/KazikovAP/maze

2. Запустить игру:

go run cmd/maze/main.go

Пример игры

Welcome to the Maze Game!
Enter maze width (default: 15): 
"Invalid width input, using default = 15"
Enter maze height (default: 15):
"Invalid height input, using default = 15"
Choose maze generation algorithm (1 - Prim, 2 - Kruskal, default Prim):
"Invalid choice, using default Prim generation algorithm"
Choose pathfinding algorithm (1 - BFS, 2 - A*, default BFS):
"Invalid choice, using default BFS pathfinding algorithm"
Generating a 15x15 maze using Prim generation and BFS pathfinding
Start: {1 4}, End: {13 13}
Path found using BFS!

▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓       ▓ ▓▓▓ ▓
▓ ▓ ▓ ▓    ▓  ▓
▓  ▓   ▓ ▓▓ ▓ ▓
▓S▓ ▓ ▓▓      ▓
▓ ▓     ▓ ▓▓▓ ▓
▓  ▓ ▓ ▓▓    ▓▓
▓ ▓  ▓   ▓ ▓  ▓
▓ ▓ ▓ ▓ ▓   ▓ ▓
▓  ▓    ▓ ▓▓ ▓▓
▓▓ ▓▓ ▓ ▓    ▓▓
▓    ▓ ▓ ▓ ▓  ▓
▓▓▓ ▓     ▓ ▓ ▓
▓     ▓ ▓   ▓E▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
Welcome to the Maze Game!
Enter maze width (default: 15): 20
Enter maze height (default: 15): 20
Choose maze generation algorithm (1 - Prim, 2 - Kruskal, default Prim): 1
Choose pathfinding algorithm (1 - BFS, 2 - A*, default BFS): 2
Generating a 20x20 maze using Prim generation and A* pathfinding
Start: {1 12}, End: {18 1}
Path found using A*!

▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓ ▓ ▓  ▓   ▓   ▓▓▓E▓
▓     ▓ ▓ ▓▓ ▓▓ ▓  ▓
▓ ▓ ▓▓▓           ▓▓
▓ ▓     ▓ ▓ ▓▓ ▓ ▓ ▓
▓  ▓ ▓▓ ▓  ▓ ▓  ▓  ▓
▓ ▓  ▓   ▓ ▓   ▓  ▓▓
▓  ▓ ▓ ▓ ▓  ▓▓  ▓ ▓▓
▓▓ ▓ ▓ ▓ ▓ ▓  ▓    ▓
▓   ▓   ▓    ▓▓▓ ▓ ▓
▓▓ ▓▓ ▓  ▓ ▓ ▓▓▓ ▓▓▓
▓▓ ▓ ▓  ▓ ▓   ▓    ▓
▓S    ▓ ▓ ▓ ▓  ▓ ▓ ▓
▓ ▓▓ ▓▓ ▓    ▓ ▓  ▓▓
▓ ▓ ▓▓  ▓ ▓ ▓   ▓  ▓
▓     ▓▓   ▓ ▓ ▓ ▓ ▓
▓ ▓▓▓ ▓  ▓ ▓      ▓▓
▓   ▓ ▓▓ ▓  ▓▓ ▓ ▓ ▓
▓ ▓  ▓   ▓ ▓   ▓   ▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
Welcome to the Maze Game!
Enter maze width (default: 15): 25
Enter maze height (default: 15): 25
Choose maze generation algorithm (1 - Prim, 2 - Kruskal, default Prim): 2
Choose pathfinding algorithm (1 - BFS, 2 - A*, default BFS): 2
Generating a 25x25 maze using Kruskal generation and A* pathfinding
Start: {1 8}, End: {23 9}
Path found using A*!

▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓   ▓ ▓     ▓   ▓       ▓
▓▓▓ ▓ ▓▓▓▓▓ ▓ ▓▓▓ ▓▓▓ ▓ ▓
▓   ▓         ▓   ▓ ▓ ▓ ▓
▓▓▓ ▓▓▓▓▓ ▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓
▓ ▓     ▓ ▓     ▓     ▓ ▓
▓ ▓▓▓ ▓▓▓▓▓ ▓ ▓▓▓ ▓ ▓▓▓▓▓
▓ ▓ ▓   ▓ ▓ ▓     ▓     ▓
▓S▓ ▓ ▓ ▓ ▓▓▓ ▓ ▓ ▓▓▓ ▓▓▓
▓ ▓   ▓ ▓ ▓   ▓ ▓   ▓  E▓
▓ ▓▓▓▓▓ ▓ ▓▓▓ ▓ ▓▓▓▓▓ ▓ ▓
▓   ▓     ▓   ▓ ▓ ▓ ▓ ▓ ▓
▓ ▓ ▓ ▓ ▓▓▓▓▓ ▓ ▓ ▓ ▓ ▓ ▓
▓ ▓ ▓ ▓ ▓     ▓     ▓ ▓ ▓
▓ ▓▓▓▓▓ ▓▓▓ ▓▓▓ ▓ ▓▓▓▓▓ ▓
▓       ▓ ▓ ▓   ▓     ▓ ▓
▓ ▓▓▓▓▓ ▓ ▓▓▓▓▓▓▓ ▓ ▓ ▓▓▓
▓   ▓             ▓ ▓   ▓
▓▓▓▓▓ ▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓ ▓▓▓
▓     ▓   ▓ ▓           ▓
▓ ▓▓▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓▓▓ ▓ ▓
▓     ▓     ▓ ▓ ▓   ▓ ▓ ▓
▓ ▓▓▓▓▓ ▓▓▓ ▓ ▓ ▓▓▓ ▓ ▓ ▓
▓ ▓     ▓         ▓   ▓ ▓
▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓

Разработал:

Aleksey Kazikov


Лицензия:

MIT

Directories

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL