1
0
Fork 0

Spreadsheet maximum/minimum size rows: 1-99 columns: 1-26 limit implemented.

pull/1/head
selim 2023-12-26 03:16:38 +01:00
parent d9b6ff9140
commit 202321681b
1 changed files with 8 additions and 1 deletions

View File

@ -26,7 +26,14 @@ public class Spreadsheet {
*/
public Spreadsheet(int rows, int cols) {
// TODO limit the maximum size on 99 (1..99) rows and 26 (A..Z) columns
if(rows>99)
rows = 99;
else if(rows<1)
rows = 1;
if(cols < 1)
cols = 1;
else if(cols > 26)
cols = 26;
cells = new Cell[rows][cols];