Test for empty grid
+--------+ | | | | | | | | | | | | | | | | +--------+ +--------+ | | | | | | | | | | | | | | | | +--------+ Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeStack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
Explore Stack InternalTest for empty grid
+--------+ | | | | | | | | | | | | | | | | +--------+ +--------+ | | | | | | | | | | | | | | | | +--------+ Test for empty grid
+--------+ | | | | | | | | | | | | | | | | +--------+ +--------+ | | | | | | | | | | | | | | | | +--------+ Your task is to create a function or a program that can take in a String of a grid lines separated by \n and outputs grid lines separated by \n (optionally including a trailing newline). The output should have lines extended as described byWhen there is a \ or a /, your program must add slashes diagonally until you reach both ends so that the introductionslashes look like a line. Whenever two lines intersect, you must replace them with X. If given an X, you must extend in both diagonal directions. You can assume that no lines have already be extended. and you can assume the border is intact. Standard I/O format applies.
+--------+ | X | | X | | | | | | | | X | | | | | +--------+ \---X-/--+ |\\\ / X | | X|\X / \ / |/ X\X \/| / / \\\ /\| |/ \\\/ \ / X\ | | / \\\ | | / \|\\| +-/------\\\ Your task is to create a function or a program that can take in a String of a grid lines separated by \n and outputs grid lines separated by \n (optionally including a trailing newline). The output should have lines extended as described by the introduction. You can assume that no lines have already be extended. and you can assume the border is intact. Standard I/O format applies.
+--------+ | X | | X | | | | | | | | X | | | | | +--------+ \---X-/--+ |\ / X | | X / \ / |/ X \/| / / \ /\| |/ \/ \ / X\ | | / \ | | / \| +-/------\ Your task is to create a function or a program that can take in a String of a grid lines separated by \n and outputs grid lines separated by \n (optionally including a trailing newline). When there is a \ or a /, your program must add slashes diagonally until you reach both ends so that the slashes look like a line. Whenever two lines intersect, you must replace them with X. If given an X, you must extend in both diagonal directions. You can assume that no lines have already be extended. and you can assume the border is intact. Standard I/O format applies.
+--------+ | X | | X | | | | | | | | X | | | | | +--------+ \---X-/--+ \\ / X | |\X / \ / |/\X \/| / /\\ /\| |/ \\/ \ / X\ | | / \\ | | / \\| +-/-----\\ Your task is to create a function or a program that can take in a String of a grid lines separated by \n and outputs grid lines separated by \n (optionally including a trailing newline). The output should have lines extended as described by the introduction. You can assume that no lines have already be extended. and you can assume the border is intact. Standard I/OStandard I/O format applies.
Your task is to create a function or a program that can take in a String of a grid lines separated by \n and outputs grid lines separated by \n (optionally including a trailing newline). The output should have lines extended as described by the introduction. You can assume that no lines have already be extended. and you can assume the border is intact. Standard I/O format applies.
Your task is to create a function or a program that can take in a String of a grid lines separated by \n and outputs grid lines separated by \n (optionally including a trailing newline). The output should have lines extended as described by the introduction. You can assume that no lines have already be extended. and you can assume the border is intact. Standard I/O format applies.