From 62fd07fcaa7cc249e4acb07964364a893e629ddb Mon Sep 17 00:00:00 2001 From: n loewen Date: Wed, 26 Jul 2023 13:52:46 +0100 Subject: [PATCH] Fix bug where hex2num and num2hex don't actually return anything --- sketches/package-lock.json | 17 +++++++++++++++++ sketches/package.json | 5 +++++ sketches/simulator-sketch-v2.js | 4 ++-- 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 sketches/package-lock.json create mode 100644 sketches/package.json diff --git a/sketches/package-lock.json b/sketches/package-lock.json new file mode 100644 index 0000000..19d8169 --- /dev/null +++ b/sketches/package-lock.json @@ -0,0 +1,17 @@ +{ + "name": "sketches", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "papaparse": "^5.4.1" + } + }, + "node_modules/papaparse": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/papaparse/-/papaparse-5.4.1.tgz", + "integrity": "sha512-HipMsgJkZu8br23pW15uvo6sib6wne/4woLZPlFf3rpDyMe9ywEXUsuD7+6K9PRkJlVT51j/sCOYDKGGS3ZJrw==" + } + } +} diff --git a/sketches/package.json b/sketches/package.json new file mode 100644 index 0000000..96fc6cc --- /dev/null +++ b/sketches/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "papaparse": "^5.4.1" + } +} diff --git a/sketches/simulator-sketch-v2.js b/sketches/simulator-sketch-v2.js index f8300a2..395197d 100644 --- a/sketches/simulator-sketch-v2.js +++ b/sketches/simulator-sketch-v2.js @@ -201,8 +201,8 @@ function logCPUState() { // FUNCTIONS FOR DISPLAYING DATA -function num2hex(num) { num.toString(16) }; -function hex2num(hex) { parseInt(hex, 16) }; +function num2hex(num) { return num.toString(16) }; +function hex2num(hex) { return parseInt(hex, 16) }; logTableTitled = (memory, tableTitle) => { console.log();