Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Problem 776. TRON strategy toggle

Created by Christopher

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.


Problem Group

Solution Statistics

29 correct solutions 12 incorrect solutions
Last solution submitted on Mar 04, 2015

Problem Comments

Solution Comments