diff --git a/index.htm b/index.htm index 0065fa2..f019e10 100644 --- a/index.htm +++ b/index.htm @@ -82,7 +82,12 @@
+ +
+ ++
diff --git a/script.js b/script.js index 27d1c37..2498c12 100644 --- a/script.js +++ b/script.js @@ -134,6 +134,7 @@ const reshape = (arg) => { // Select let rows = document.getElementById("rows"); +let columns = document.getElementById("columns"); const access = () => { if (variable.value === "") { @@ -162,3 +163,17 @@ const accessRows = () => { document.editor.textbox.value+="\n" + variable.value + "_rows = " + variable.value + "[" + row.value + "::" + rows.value + "]"; } } + +const accessColumn = () => { + if (variable.value === "") { + return alert("Please enter a variable name in the 'Create Tensor' section"); + } else if (row.value === "") { + return alert("Please enter a number in the 'row' field in the 'Tensor functions' section."); + } else if (rows.value === "") { + return alert("Please enter a number in the 'rows' field in the 'Select' section."); + } else if (columns.value === "") { + return alert("Please enter a number in the 'columns' field in the 'Select' section."); + } else { + document.editor.textbox.value+="\n" + variable.value + "_column = " + variable.value + "[" + row.value + ":" + rows.value + ", " + columns.value + "]"; + } +} diff --git a/styles.css b/styles.css index 5a21e36..0acd3b6 100644 --- a/styles.css +++ b/styles.css @@ -106,3 +106,6 @@ input[type="number"] { width: 60px; } +#columns { + width: 70px; +}