new slim guide just dropped
Introduction
This guild is approx. 2-4% memory, depending on several factors. I used 6-7% memory testing it, making sure certain values were correct that didn’t appear in the game.
Base 10 is the dominant counting technique we use as humans. The numerals of base 10 are 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
. When we get to 9
, we have no numerals left in one-digit numbers. We start over from the beginning, so 01
right? Not exactly. Putting 0
before any number like 01
just converts it to 1
. Now, we need to proceed to our next number, 1
. We start over, now we’re at 10
. When trying to understand other bases, do not say ten. Instead, say one zero. This guide is not about base 10 folks, it’s about other bases besides base 10. You presumably know base 10 because that’s our everyday counting technique. What if we had a base other than 10? What about 5? Well, base 5 proceeds as follows: 0, 1, 2, 3, 4
. Once we run out of numbers, we restart to the beginning, 10
. [1] Binary runs on base 2. It goes 0, 1, 10, 11, 100, 101, 110, 111, 1000
. What if we go larger than base 10? How about base 11? It would be 0-9
, but add another value: a
. [2] Here are some math problems below in base 11, and watch a video here to learn more.
9 + 1 = a
a + 1 = 10
6 + a = 15
20 + a = 2a
This guide expands the use of my last guide.
Part 1 of 3:
The only way this is possible is we convert the currently selected base into base 10, then back into our currently selected base. Let’s say we are in base 11. We make a list of all the one-digit numbers. [3] 0 = 0, 1 = 1, and so on. What do we do when we get to a
? Well, 9 = 9, so we get the next digit, which is 10; a = 10. Now why does this work? Let me explain- in the code, we get the letter number. a is the 10th numeral in line [4], so getting letter number 10 [5] would get us a
. That, my friend, is exactly how the basic premise of what this code does. Wow, so cool!
Part one focuses on building the calculating part, while part two focuses on inserting custom inputs mid-game. Part 3 sets up the counter and text for answer, 1st input, 2nd input, etc.
First, set up some properties. Reference the table below to find each one.
Property Name | Property Type | Default Value |
---|---|---|
alphabetMax |
text | 0123456789abcdefghijklmnopqrstuvwxyz |
selectedAlphabet |
text | none |
input1 |
text | none |
input2 |
text | none |
answer |
text | none |
leftoverChecking |
true/false | false |
inputOverall |
number | 0 |
"tens" |
number | 1 |
"hundreds" |
number | 1 |
counter |
number | 0 |
countCounter |
number | 0 |
baseNumberA |
number | 0 |
baseNumberB |
number | 0 |
Bulk of properties
Property Name | Property Type | Default Value |
---|---|---|
0 |
number | 0 |
1 |
number | 1 |
2 |
number | 2 |
3 |
number | 3 |
4 |
number | 4 |
5 |
number | 5 |
6 |
number | 6 |
7 |
number | 7 |
8 |
number | 8 |
9 |
number | 9 |
a |
number | 10 |
b |
number | 11 |
c |
number | 12 |
d |
number | 13 |
e |
number | 14 |
f |
number | 15 |
g |
number | 16 |
h |
number | 17 |
i |
number | 18 |
j |
number | 19 |
k |
number | 20 |
l |
number | 21 |
m |
number | 22 |
n |
number | 23 |
o |
number | 24 |
p |
number | 25 |
q |
number | 26 |
r |
number | 27 |
s |
number | 28 |
t |
number | 29 |
u |
number | 30 |
v |
number | 31 |
w |
number | 32 |
x |
number | 33 |
y |
number | 34 |
z |
number | 35 |
Step 1
Place a trigger. The only setting you need to change is trigger when receiving on
. Set that to math
. This trigger will run whenever a math calculation needs to be completed.
Step 2
Create a block code section inside the trigger you just placed. Before we start, copy these variables into your code. These variables are essential for getting under the block limit.
Step 3
Add this if statement below the variables. This is working a bit backward because this trigger does the last half of the calculations to fit certain blocks. The inputOverall
property gives us the actual result, but it might say 23 places over in the ones spot. If we had base 10, that would be 23, but the game doesn’t know it has a number greater than 10 yet. It just knows it has 23 ones, so this piece of code subtracts the appropriate number from the ones and adds +1 to the tens. Now it knows it has 1 ten, and 13 ones. It does it a second time; the result is 2 tens and 3 ones, creating 23 in the answer.
Are You following yet? Okay, good.
Step 4
Bring in the rest of the code by setting up the answer property. selectedAlphabet
has the list of the currently selected base. It gets the letter # of the ones, tens, and hundreds place. Lastly, it broadcasts messages on updateAnswer
Correcting any mistakes.
I noticed some mistakes in my code, but it still works. First, move the broadcast message on channel: math
right after the set property value: combinedMath
block.
Then, move set property value: answer
and broadcast message on channel: updateAnswer
inside the else.
Double-check that everything is correct, and that is the end of part 1! Wahoo!
Part 2 of 3:
This is the second part, which can customize the inputs mid-game and the first half of the calculations. This system can support two inputs, both 2-digit numbers. If you want a 1-digit number, put a 0 before one or both inputs.
Step 1
Place a second trigger. It should trigger when receiving on triggerSetup1
. Then, create a new block code inside the trigger. Insert the variables according to the image below. Continue to step 2.
Step 2
We are using a single counter to set everything up. The number the counter represents is plac.ed in the property counter
. There is quite a handful of stuff that the counter changes. To keep track of what value we need to change, we increment a property called countCounter
. Fantastic name, me. Jokes aside, this first if statement should always run first.
The player sets the custom base number first. If the counter shows the number 2
, then the selectedAlphabet
should be set to 01
. If you didn’t know, alphametMax
[6] is set to 0123456789abcdefghijklmnopqrstuvwxyz
. To set the property to 01
, it’s really quite simple. Get a substring from the first letter to the letter # of the counter. Remember, the counter should show 2
when trying to get 01
, as in base 2.
For a later time, we need to set baseNumberA
and baseNumberB
to the values in the image. The -
sign in baseNumberA
is a negative sign, found in the math branch. I will explain later why we need them.
Step 3
so much typing ahh
The rest of the if statement is so similar, that I decided to combine it into one step.
Add three else ifs to the if statement. This is making both inputs using one property. If the first input is 12, and the second is 2b, then it combines to create 122b
. We can separate it back out later.
Do you remember me saying that we always add +1 to account for the zero? If our counter said 2
, we want the second number. Since 0
is technically letter #1, we can’t get letter #0 if the counter is set to 0
, so that is why we add +1. [7]
Correcting
The whole setup for trigger two is seen in the image below. Change anything you missed here.
Step 4
Place a third and final trigger. This trigger should trigger when receiving on triggerSetup2
.
Step 5
Create a new block coding section in this trigger-- as always, set up these variables first.
Step 6
Place a new if statement below the variables. Read step 3 for an explanation because it’s the same thing, just another digit.
Step 7
Corrections
After completing steps 4-7, you should be lead to this image.
Part 3 of 3:
Part three shows how to set up the counter and text to show answers and what-not.
Step 1
Place a counter. It incriments when receiving on increase
and decreases on decrease
. Set the counter to update the property, counter
. Put overlays on the left and right corner of your screen that transmit on increase
or decrease
when you click them.
Step 2
Place a new text block. Create a new block code section that runs on updateText
. Set the text to the property, selectedAlphabet
.
Step 3
Place yet another text block, run code inside when receiving on updateText
to shot the first input. It should get the first two numbers/letters of the property inputOverall
.
Step 4
Do the exact same as step three, but this time it needs to get the last two numbers of the property to represent the second input.
Step 5
Place down a new text device. This time, it runs the block when receiving on updateAnswer
. Fetch the property answer
to display the answer.
Step 6
After completing part three, you should have something that looks like this. The debug numbers are for testing, but you can see the base, first and second inputs, and the answer. You can always change the appearance of the text like I did.
Exit
This should be finished! If you understand how it works, good for you! Now, you may be asking, slim, how is this gonna help me? If you are making something like my randomly generated maze guide, then it relies solely on one-digit numbers. Creating higher bases solves this problem.
I am so excited to publish this guide so lets get to it.
polls
- My calculator couldn’t stop adding to the conversation.
- You tried to make a math pun, but my laughter didn’t add up.
- I prefer to use my calmulator for tricky problems.
- My calculator went to therapy because it had too many unresolved issues.
- does this guy ever quit with his jokes ._.
- 1/10
- 2/10
- 3/10
- 4/10
- 5/10
- 6/10
- 7/10
- 8/10
- 9/10
- 10/10
- Yes!
- No!
After hours of hard work and dedication, I really hope you enjoyed this guide.
Remember to stay positive!
Here is a full list of base 5 until we reach three digits:
0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 30, 31, 32, 33, 34, 40, 41, 42, 43, 44, 100.
↩︎0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a
↩︎0123456789a
↩︎Besides 0; I’ll get to that in a bit. ↩︎
+1, accounting for the 0, ↩︎
Again, you can always rename properties/variables. ↩︎
the more you know
↩︎