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.9% Correct | 38.1% Incorrect
Last Solution submitted on Mar 30, 2024

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers18

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!