GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — more! · syohnet/AlgorithmVisualizer@bef9e8f

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • algorithm/sandbox/sandbox/sandbox
    • data.js
  • index.html
  • js
    • create
      • index.js
      • sb.js
    • index.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎algorithm/sandbox/sandbox/sandbox/data.js‎

Copy file name to clipboard
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
var logger = new LogTracer();
Collapse file

‎index.html‎

Copy file name to clipboardExpand all lines: index.html
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,16 @@ <h3>
131131
<div>
132132
<div>
133133
# of Rows:
134-
<input id="numRows" type="number" value="0">
134+
<input id="numRows" type="number" value="5">
135135
</div>
136136

137137
<div>
138138
# of Columns:
139-
<input id="numColumns" type="number" value="0">
139+
<input id="numColumns" type="number" value="5">
140+
</div>
141+
142+
<div>
143+
<button id="button-2DMatrix">Create 2DMatrix</button>
140144
</div>
141145
</div>
142146
</div>
Collapse file

‎js/create/index.js‎

Copy file name to clipboard
+37-5Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
11
'use strict';
22

3-
var sandbox = require('./sb');
3+
const modules = require('../module');
44

5-
const CAT = () => {
6-
console.log("DOG");
5+
const getNumRows = () => {
6+
var row_field = document.getElementById("numRows");
7+
return row_field.value;
78
};
89

10+
const getNumColumns = () => {
11+
var column_field = document.getElementById("numColumns");
12+
return column_field.value;
13+
};
14+
15+
const fauxData = (r, c) => {
16+
var arr = new Array(r);
17+
for (var i = 0; i < c; i++) {
18+
arr[i] = new Array(c);
19+
}
20+
21+
for (var i = 0; i < r; i++) {
22+
for(var j = 0; j < c; j++){
23+
arr[i][j] = 0;
24+
}
25+
}
26+
return arr;
27+
};
28+
29+
const setupButtons = () => {
30+
31+
var button_2DMatrix = document.getElementById("button-2DMatrix");
32+
button_2DMatrix.addEventListener('click',function(){
33+
var arr2DTracer = new modules.Array2DTracer();
34+
var numRows = getNumRows();
35+
var numColumns = getNumColumns();
36+
var data = fauxData(numRows, numColumns);
37+
console.log(data);
38+
arr2DTracer.setData(data);
39+
},false);
40+
};
941

1042
module.exports = {
11-
CAT
12-
}
43+
setupButtons
44+
};
Collapse file

‎js/create/sb.js‎

Copy file name to clipboard
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
'use strict';
22

3-
const PRINT = () => {
4-
console.log("hiya");
5-
};
63

74
module.exports = {
8-
PRINT
5+
96
};
Collapse file

‎js/index.js‎

Copy file name to clipboardExpand all lines: js/index.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ $(() => {
7373
} else {
7474
DOM.showFirstAlgorithm();
7575
}
76+
77+
Sandbox.setupButtons();
78+
7679
});
7780

7881
Server.loadWikiList().then((data) => {

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.