- 499 views, 2 today
- 13 downloads, 0 today
61
Basically, this is a redstone/command block machine used to determine the individual digits in (for this example) an 8-digit number. This is useful because without it, you'd have to have many seperate number generators for some kind of map that uses random parts.
Note: this must be used in the latest 1.8 snapshot!
How it works:
This is just a basic and uncompacted design!
Note: this must be used in the latest 1.8 snapshot!
How it works:
- A random number 1-8 is picked. For example: 6.
- That number is multiplied by 10. It's now 60.
- The machine goes back and picks another random number 1-8 and adds it. If the number chosen now was 3, then the number is 63.
- It's multiplied by 10 again, and this process will continue until we have our number to the length we desire (in this case, my machine is programed to an 8-digit number). 63487221 as an example.
- The machine sets players named Digit1, Digit2, etc. under a scoreboard objective calld "Digit" to that 8-digit number that was generated. This will be used so we can changed each specific Digit# relative to the original number through mathematics. Each Digit# now has a score of 63487221.
- This is where it gets fun: Digit1 is simply divided by 10,000,000. 63487221 / 10000000 = 6.3487221. However, Minecraft doesn't use decimals, so it becomes 6.
- Digit2-7 use a different method: First we use Digit2 mod 10,000,000 to get rid of the first digit. Then, we divide that by 1,000,000 to get just that digit. 63487221 mod 10000000 = 3487221; 3487221 / 1000000 = 3
- Each number going up until 7 uses one less zero for both the modulus and division.
- At 8 we just use Digit8 mod 10 and do not divide (as dividing would just be dividing by 1). So really, 1 and 8 are under the same pattern, but it's pointless to a step as it won't change anything. 63487221 mod 10 = 1; If Digit1 used modulus: 63487221 mod 10000000 = 63487221 and if we divided it by 1 (for Digit8) it would be the same as well.
This is just a basic and uncompacted design!
Progress | 100% complete |
Tags |
1 Update Logs
Color-Coded : by DaSquyd 06/23/2014 12:27:24 pmJun 23rd, 2014
Each part of the design has been color-coded.
tools/tracking
2547973
2
proof-of-concept-digit-scanner-for-a-random-number
Create an account or sign in to comment.