Problem 776. TRON strategy toggle

Detect whether your lightcycle is on same side of existing walls as opponents lightcycle. This function is useful in toggling a tron algorithm from agressive/strategic mode (chasing and hassling opponent) to passive/efficiency mode (wherein you'd presumably focus on using up remaining space, and wouldn't have to bother tracking opponent, etc.). Inspired by Alfonso Nieto-Castanon's Problem 327, as well as Richard Zapor's followups.
input: 50 by 50 matrix of lightcycle and wall positions, empty space = 0, lightcycles = 1 & 2, outer walls = -3, lightcycle trails/walls = -1 and -2.
output: true if on same side, or false if no path exists between the two light cycles.

Solution Stats

61.29% Correct | 38.71% Incorrect
Last Solution submitted on Feb 12, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers17

Suggested Problems

More from this Author3

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!