Skip to content

Commit

Permalink
fix number display in register and input boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Maurits van Riezen committed Apr 12, 2024
1 parent 41f5a29 commit 5a1a172
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/scripts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function update_ui_for_program(o: AnyTypeProgramState) {
stack_div.innerText = o.stacks.map(i => i.contents.map(j => o.number_implementation.toString(j)).join(' ')).join('\n');

cursor_postion_box.textContent = JSON.stringify(o.cursor);
register_box.textContent = o.stacks.map(i => i.register).join(', ');
register_box.textContent = o.stacks.map(i => o.number_implementation.toString(i.register)).join(', ');
}

let program_state: AnyTypeProgramState = {
Expand Down Expand Up @@ -195,7 +195,7 @@ function initializeProgramState<T>(
input_queue.reverse();
let val = input_queue.pop() ?? number_implementation.fromInt(-1);
input_queue.reverse();
input_queue_div.textContent = input_queue.join(' ');
input_queue_div.textContent = input_queue.map(number_implementation.toString).join(' ');
return val;
},
output: (o: T) => {
Expand Down
4 changes: 3 additions & 1 deletion src/style/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ body {
}

.two-columns>div {
flex-grow: 1;
min-width: 0;
min-height: 0;
}

.flex {
Expand Down Expand Up @@ -137,6 +138,7 @@ button:hover:not(:disabled) {

.program {
white-space: pre;
overflow-x: auto;
}

.cursor {
Expand Down

0 comments on commit 5a1a172

Please sign in to comment.