Minecraft Maps / Redstone Device

[Proof of Concept] Digit Scanner for a random number

  • 499 views, 2 today
  • 13 downloads, 0 today
  • 7
  • 2
  • 3
DaSquyd's Avatar DaSquyd
Level 32 : Artisan Toast
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:
  1. A random number 1-8 is picked. For example: 6.
  2. That number is multiplied by 10. It's now 60.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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
  8. Each number going up until 7 uses one less zero for both the modulus and division.
  9. 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!
Progress100% 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.

Create an account or sign in to comment.

1
05/13/2015 7:05 pm
Level 49 : Master Crafter
mick_5
mick_5's Avatar
That is awesome your knowledge of command blocks is impressive
1
06/21/2014 9:15 pm
Level 2 : Apprentice Miner
grantjayson
grantjayson's Avatar
Wow great job this must have taken along time to build. I couldn't build anything close to that I suck at redstone
1
06/21/2014 9:22 pm
Level 32 : Artisan Toast
DaSquyd
DaSquyd's Avatar
Thanks! It didn't take that long. I had an idea on how to do it, and so I made it come to life!
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome