SpiralMatrixPrint in C#
A common test for developers as job candidates. Here's my take
The concept in this version is to move the 'printing pointer' of x & y in the correct direction for each portion of the spiral with only a single concatenation statement.
This is a Visual Studio 2019 MVC Web Application solution for .Net Framework 4.7.2
- Run the Web App.
- Click the 'Spiral' Menu item
- The first run, on page load, just prints out the array rows.
- Check the 'Ordered' checkbox
- Hit run
- The result is a string of the Alpabet in order for most letters that fit into the 5x5 matrix
You can place a breakpoint on line 72 of ~\Contollers\HomeController.cs to follow along