diff --git a/README.md b/README.md
index 95677b0..127faa0 100644
--- a/README.md
+++ b/README.md
@@ -14,12 +14,12 @@ to be a billion dollar project.
# The Machine
Buttons is a simple stack machine with arbitrary registers and a limited amount of power known as
-"ticks" of which you have 128. What does that mean in practice?
+"clicks" of which you have 128. What does that mean in practice?
1. You do most of your calculations by working a stack with PUSH and POP.
2. You can store things in a register and name that register anything you want.
3. Every operation takes 1 tick to process.
-4. You have only 128 ticks to complete your calculation.
+4. You have only 128 clicks to complete your calculation.
5. You can do all of this with only a single mouse with two buttons.
6. The data type for the stack is whatever JavaScript does with numbers.
@@ -100,3 +100,14 @@ This software is fully Copyright (C) Zed A. Shaw 2020. It's like a painting at
look at it and admire its beauty, but you don't own it and can't take it home with you.
+# Feature Requests
+
+Currently have the following feature requests:
+
+1. SWAP operation would simplify a lot of calculations.
+2. A share this code link to share the code with others.
+3. PEEK and POKE for writing to a RAM spot.
+4. IN and OUT for reading and writing numbers.
+5. Edit it as CODE instead of clicking if you want.
+6. Better line number display.
+
diff --git a/__tests__/buttons.spec.js b/__tests__/buttons.spec.js
index 715caf0..1d799c9 100644
--- a/__tests__/buttons.spec.js
+++ b/__tests__/buttons.spec.js
@@ -50,7 +50,7 @@ it('Can do modulus', () => {
])
})
-it('Can loop until the end of ticks', () => {
+it('Can loop until the end of clicks', () => {
run_code(43, [
['PUSH', 1],
['PUSH', 1],
diff --git a/package.json b/package.json
index ef351d9..4d92839 100644
--- a/package.json
+++ b/package.json
@@ -26,9 +26,6 @@
"svelte-preprocess": "^4.1.2"
},
"devDependencies": {
- "npm-run-all": "^4.1.5",
- "sapper": "^0.28.0",
- "svelte": "^3.17.3",
"@babel/core": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
@@ -38,8 +35,11 @@
"@rollup/plugin-commonjs": "^14.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"@rollup/plugin-replace": "^2.2.0",
+ "npm-run-all": "^4.1.5",
"rollup": "^2.3.4",
"rollup-plugin-svelte": "^6.0.0",
- "rollup-plugin-terser": "^7.0.0"
+ "rollup-plugin-terser": "^7.0.0",
+ "sapper": "^0.28.0",
+ "svelte": "^3.17.3"
}
}
diff --git a/src/components/Nav.svelte b/src/components/Nav.svelte
index c85e347..c17352f 100644
--- a/src/components/Nav.svelte
+++ b/src/components/Nav.svelte
@@ -36,8 +36,8 @@
BUTTONS
is a tiny computer that you can program entirely with a 2 button mouse by clicking on buttons.
@@ -57,7 +57,7 @@
plates done plates
.
You would probably take the first plate off the top of the stack of
- plates, write the number 1
on it, and then set it to the
+ new plates
, write the number 1
on it, and then set it to the
side in the done plates
stack. You can't put it back on the
new plates
stack of plates because then you wouldn't make
your way through the plates. You take one off the top
of
@@ -67,7 +67,7 @@
going through all 10 plates.
You then look over at your stack of numbered done plates
- and you're happy, but the plate on top
is numbered 20.
+ and you're happy, but the plate on top
is numbered 10.
You've stacked them in reverse, and you probably need to re-stack them in
order. How would you do that? Well, you simply take one off the top of
the done stack
and put it onto another stack (let's call
@@ -159,13 +159,13 @@
When you see the 0:
at the front of the line that's the line number. It's not code, just me being lazy and not wanting to implement line numbers in fancy CSS.
-
Before we get into loops I have to warn you that BUTTONS
is not a very powerful computer. It can only perform 128
- operations before it runs out of energy called TICKS
. If
- your computer runs this many ticks then BUTTONS
will stop
- running and give up.
CLICKS
. If
+ your program runs for 128 many clicks then BUTTONS
will stop
+ running and give up because it is tired.
You run it, thinking it will stop at zero, and instead
BUTTONS
does exactly what you told it to do and keeps going
- until it runs out of TICKS
, leaving .... -32
on
+ until it runs out of CLICKS
, leaving .... -32
on
the top? What?!
The reason is you have no way to tell BUTTONS
when to stop. You can tell it to do the math and where to JUMP
but you have no way to tell buttons "when you reach 0 on the STACK
you should stop." You do this with the JZ
operation which means "JUMP if Zero
". It simply looks at the top of the STACK
and if that's 0 then it does a JUMP
to where you want. This is doing a test of the top of stack, and a jump. Now we can rewrite our program like this: