Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply 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.

Tags

Problem Group

Solution Statistics

15 correct solutions 8 incorrect solutions
Last solution submitted on Mar 12, 2013

Problem Comments

Solution Comments