{"group":{"id":1,"name":"Community","lockable":false,"created_at":"2012-01-18T18:02:15.000Z","updated_at":"2026-05-26T00:16:20.000Z","description":"Problems submitted by members of the MATLAB Central community.","is_default":true,"created_by":161519,"badge_id":null,"featured":false,"trending":false,"solution_count_in_trending_period":0,"trending_last_calculated":"2026-05-26T00:00:00.000Z","image_id":null,"published":true,"community_created":false,"status_id":2,"is_default_group_for_player":false,"deleted_by":null,"deleted_at":null,"restored_by":null,"restored_at":null,"description_opc":null,"description_html":null,"published_at":null},"problems":[{"id":173,"title":"Minefield Sonar","description":"*Background*\r\n\r\nIn mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left click, uncovers a hint as to the bombs around it or a bomb itself. The goal of this problem is to generate this grid based on the placement of a number of bombs and the puzzle size.\r\n\r\nMore information can be found on the \u003chttp://en.wikipedia.org/wiki/Minesweeper_(computer_game) Wikipedia page\u003e.\r\n\r\n*Description*\r\n\r\nYou are provided with the row and column of _K_ mines on a grid, _I_ and _J_ respectively, as well as the number of rows and columns on the grid, _M_ and _N_ respectively. Using this information, generate an _M_ x _N_ grid where the values on the grid represent the number of mines adjacent to that square or, if there is a mine on that particular square, the value -1.\r\n\r\n*Example*\r\n\r\n","description_html":"\u003cp\u003e\u003cb\u003eBackground\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIn mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left click, uncovers a hint as to the bombs around it or a bomb itself. The goal of this problem is to generate this grid based on the placement of a number of bombs and the puzzle size.\u003c/p\u003e\u003cp\u003eMore information can be found on the \u003ca href=\"http://en.wikipedia.org/wiki/Minesweeper_(computer_game)\"\u003eWikipedia page\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eDescription\u003c/b\u003e\u003c/p\u003e\u003cp\u003eYou are provided with the row and column of \u003ci\u003eK\u003c/i\u003e mines on a grid, \u003ci\u003eI\u003c/i\u003e and \u003ci\u003eJ\u003c/i\u003e respectively, as well as the number of rows and columns on the grid, \u003ci\u003eM\u003c/i\u003e and \u003ci\u003eN\u003c/i\u003e respectively. Using this information, generate an \u003ci\u003eM\u003c/i\u003e x \u003ci\u003eN\u003c/i\u003e grid where the values on the grid represent the number of mines adjacent to that square or, if there is a mine on that particular square, the value -1.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e","function_template":"function y = minehunting(I,J,M,N)\r\n    y = zeros(M,N);\r\nend","test_suite":"%%\r\nI = [ 2 3 3 5 1 4 9 2 3 9 ];\r\nJ = [ 1 1 4 4 5 5 6 8 8 9 ];\r\nM = 9; N = 9;\r\ny_correct = [  1  1  0  1 -1  1  1  1  1\r\n              -1  2  1  2  2  1  2 -1  2\r\n              -1  2  1 -1  2  1  2 -1  2\r\n               1  1  2  3 -1  1  1  1  1\r\n               0  0  1 -1  2  1  0  0  0\r\n               0  0  1  1  1  0  0  0  0\r\n               0  0  0  0  0  0  0  0  0\r\n               0  0  0  0  1  1  1  1  1\r\n               0  0  0  0  1 -1  1  1 -1 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n%%\r\nI = 9; J = 9; M = 9; N = 9;\r\ny_correct = [ 0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  1  1\r\n              0  0  0  0  0  0  0  1 -1 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n%%\r\nI = 5; J = 5; M = 9; N = 9;\r\ny_correct = [ 0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  1  1  1  0  0  0\r\n              0  0  0  1 -1  1  0  0  0\r\n              0  0  0  1  1  1  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n%%\r\n[I,J] = ndgrid(1:2:11,1:2:5);\r\nM = 11; N = 5;\r\ny_correct = [ -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n%%\r\n[I,J] = ndgrid(2:3:11,2:3:5);\r\nM = 11; N = 5;\r\ny_correct = [ 1  1  1  1  1\r\n              1 -1  1  1 -1\r\n              1  1  1  1  1\r\n              1  1  1  1  1\r\n              1 -1  1  1 -1\r\n              1  1  1  1  1\r\n              1  1  1  1  1\r\n              1 -1  1  1 -1\r\n              1  1  1  1  1\r\n              1  1  1  1  1\r\n              1 -1  1  1 -1 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":23,"comments_count":1,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":311,"test_suite_updated_at":"2012-01-30T07:18:52.000Z","rescore_all_solutions":false,"group_id":33,"created_at":"2012-01-30T07:11:24.000Z","updated_at":"2026-05-05T21:35:40.000Z","published_at":"2012-01-30T07:18:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eBackground\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left click, uncovers a hint as to the bombs around it or a bomb itself. The goal of this problem is to generate this grid based on the placement of a number of bombs and the puzzle size.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMore information can be found on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Minesweeper_(computer_game)\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWikipedia page\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou are provided with the row and column of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mines on a grid,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eI\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eJ\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e respectively, as well as the number of rows and columns on the grid,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eM\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e respectively. Using this information, generate an\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eM\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e x\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e grid where the values on the grid represent the number of mines adjacent to that square or, if there is a mine on that particular square, the value -1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"problem_search":{"problems":[{"id":173,"title":"Minefield Sonar","description":"*Background*\r\n\r\nIn mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left click, uncovers a hint as to the bombs around it or a bomb itself. The goal of this problem is to generate this grid based on the placement of a number of bombs and the puzzle size.\r\n\r\nMore information can be found on the \u003chttp://en.wikipedia.org/wiki/Minesweeper_(computer_game) Wikipedia page\u003e.\r\n\r\n*Description*\r\n\r\nYou are provided with the row and column of _K_ mines on a grid, _I_ and _J_ respectively, as well as the number of rows and columns on the grid, _M_ and _N_ respectively. Using this information, generate an _M_ x _N_ grid where the values on the grid represent the number of mines adjacent to that square or, if there is a mine on that particular square, the value -1.\r\n\r\n*Example*\r\n\r\n","description_html":"\u003cp\u003e\u003cb\u003eBackground\u003c/b\u003e\u003c/p\u003e\u003cp\u003eIn mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left click, uncovers a hint as to the bombs around it or a bomb itself. The goal of this problem is to generate this grid based on the placement of a number of bombs and the puzzle size.\u003c/p\u003e\u003cp\u003eMore information can be found on the \u003ca href=\"http://en.wikipedia.org/wiki/Minesweeper_(computer_game)\"\u003eWikipedia page\u003c/a\u003e.\u003c/p\u003e\u003cp\u003e\u003cb\u003eDescription\u003c/b\u003e\u003c/p\u003e\u003cp\u003eYou are provided with the row and column of \u003ci\u003eK\u003c/i\u003e mines on a grid, \u003ci\u003eI\u003c/i\u003e and \u003ci\u003eJ\u003c/i\u003e respectively, as well as the number of rows and columns on the grid, \u003ci\u003eM\u003c/i\u003e and \u003ci\u003eN\u003c/i\u003e respectively. Using this information, generate an \u003ci\u003eM\u003c/i\u003e x \u003ci\u003eN\u003c/i\u003e grid where the values on the grid represent the number of mines adjacent to that square or, if there is a mine on that particular square, the value -1.\u003c/p\u003e\u003cp\u003e\u003cb\u003eExample\u003c/b\u003e\u003c/p\u003e","function_template":"function y = minehunting(I,J,M,N)\r\n    y = zeros(M,N);\r\nend","test_suite":"%%\r\nI = [ 2 3 3 5 1 4 9 2 3 9 ];\r\nJ = [ 1 1 4 4 5 5 6 8 8 9 ];\r\nM = 9; N = 9;\r\ny_correct = [  1  1  0  1 -1  1  1  1  1\r\n              -1  2  1  2  2  1  2 -1  2\r\n              -1  2  1 -1  2  1  2 -1  2\r\n               1  1  2  3 -1  1  1  1  1\r\n               0  0  1 -1  2  1  0  0  0\r\n               0  0  1  1  1  0  0  0  0\r\n               0  0  0  0  0  0  0  0  0\r\n               0  0  0  0  1  1  1  1  1\r\n               0  0  0  0  1 -1  1  1 -1 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n%%\r\nI = 9; J = 9; M = 9; N = 9;\r\ny_correct = [ 0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  1  1\r\n              0  0  0  0  0  0  0  1 -1 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n%%\r\nI = 5; J = 5; M = 9; N = 9;\r\ny_correct = [ 0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  1  1  1  0  0  0\r\n              0  0  0  1 -1  1  0  0  0\r\n              0  0  0  1  1  1  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0\r\n              0  0  0  0  0  0  0  0  0 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n%%\r\n[I,J] = ndgrid(1:2:11,1:2:5);\r\nM = 11; N = 5;\r\ny_correct = [ -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1\r\n               2  4  2  4  2\r\n              -1  2 -1  2 -1 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n%%\r\n[I,J] = ndgrid(2:3:11,2:3:5);\r\nM = 11; N = 5;\r\ny_correct = [ 1  1  1  1  1\r\n              1 -1  1  1 -1\r\n              1  1  1  1  1\r\n              1  1  1  1  1\r\n              1 -1  1  1 -1\r\n              1  1  1  1  1\r\n              1  1  1  1  1\r\n              1 -1  1  1 -1\r\n              1  1  1  1  1\r\n              1  1  1  1  1\r\n              1 -1  1  1 -1 ];\r\nassert(isequal(minehunting(I,J,M,N),y_correct))\r\n\r\n","published":true,"deleted":false,"likes_count":23,"comments_count":1,"created_by":134,"edited_by":null,"edited_at":null,"deleted_by":null,"deleted_at":null,"solvers_count":311,"test_suite_updated_at":"2012-01-30T07:18:52.000Z","rescore_all_solutions":false,"group_id":33,"created_at":"2012-01-30T07:11:24.000Z","updated_at":"2026-05-05T21:35:40.000Z","published_at":"2012-01-30T07:18:52.000Z","restored_at":null,"restored_by":null,"spam":false,"simulink":false,"admin_reviewed":false,"description_opc":"{\"relationships\":[{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/document\",\"targetMode\":\"\",\"relationshipId\":\"rId1\",\"target\":\"/matlab/document.xml\"},{\"relationshipType\":\"http://schemas.mathworks.com/matlab/code/2013/relationships/output\",\"targetMode\":\"\",\"relationshipId\":\"rId2\",\"target\":\"/matlab/output.xml\"}],\"parts\":[{\"partUri\":\"/matlab/document.xml\",\"relationship\":[],\"contentType\":\"application/vnd.mathworks.matlab.code.document+xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\\n\u003cw:document xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\u003e\u003cw:body\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eBackground\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eIn mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left click, uncovers a hint as to the bombs around it or a bomb itself. The goal of this problem is to generate this grid based on the placement of a number of bombs and the puzzle size.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eMore information can be found on the\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:hyperlink w:docLocation=\\\"http://en.wikipedia.org/wiki/Minesweeper_(computer_game)\\\"\u003e\u003cw:r\u003e\u003cw:t\u003eWikipedia page\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:hyperlink\u003e\u003cw:r\u003e\u003cw:t\u003e.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eDescription\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:t\u003eYou are provided with the row and column of\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eK\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e mines on a grid,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eI\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eJ\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e respectively, as well as the number of rows and columns on the grid,\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eM\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e and\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e respectively. Using this information, generate an\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eM\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e x\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e \u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:i/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eN\u003c/w:t\u003e\u003c/w:r\u003e\u003cw:r\u003e\u003cw:t\u003e grid where the values on the grid represent the number of mines adjacent to that square or, if there is a mine on that particular square, the value -1.\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003cw:p\u003e\u003cw:pPr\u003e\u003cw:pStyle w:val=\\\"text\\\"/\u003e\u003c/w:pPr\u003e\u003cw:r\u003e\u003cw:rPr\u003e\u003cw:b/\u003e\u003c/w:rPr\u003e\u003cw:t\u003eExample\u003c/w:t\u003e\u003c/w:r\u003e\u003c/w:p\u003e\u003c/w:body\u003e\u003c/w:document\u003e\"},{\"partUri\":\"/matlab/output.xml\",\"contentType\":\"text/xml\",\"content\":\"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\" standalone=\\\"no\\\" ?\u003e\u003cembeddedOutputs\u003e\u003cmetaData\u003e\u003cevaluationState\u003emanual\u003c/evaluationState\u003e\u003clayoutState\u003ecode\u003c/layoutState\u003e\u003coutputStatus\u003eready\u003c/outputStatus\u003e\u003c/metaData\u003e\u003coutputArray type=\\\"array\\\"/\u003e\u003cregionArray type=\\\"array\\\"/\u003e\u003c/embeddedOutputs\u003e\"}]}"}],"errors":[],"facets":[[{"value":"Computer Games I","count":1,"selected":false}],[{"value":"medium","count":1,"selected":false}]],"term":"tag:\"minesweeper\"","page":1,"per_page":50,"sort":"map(difficulty_value,0,0,999) asc"}}