• For issues you find with the Switch and Console releases, please follow this link and give as much detail as possible. This is the speediest way to get info to Pipeworks and get a hotfix in the works.
  • For issues you find with the Mobile 1.3 update, please follow this link and give as much detail as possible. This is the speediest way to get info to DR Studios to look at your issue. Also, some troubleshooting hints here.

PC Random Decimal Number Generator (Including display)

Borg

Terrarian
Hi everyone,

I am very happy to have found this forum. I am new here and want to show what I made. I could not have done it without the guides found on this forum (thanx for that) so I might as well share my work.

I make use of faulty lamps that each have a 1/10 chance of activating. Because multiple ones or none can be activated I check whether only one is activated using a XOR gate. If this fails it tries again and again until only one is activated. When the XOR gate activates the loop is broken and the corresponding pulses are sent to the decimal counter through pulses by darts + teal pressure plates (1-9) and 1 second timed dummy ghost engines with a pulse divider.

My plan is to generate random numbers so I can approximate pi through Monte Carlo Simulation. During the end of making this machine I found out that generating a binary can be easily done in one tick since every number has a 1/2 chance to be either 0 or 1, so this creation is kind of useless, but still fun to chill out in my ufo and watch numbers appear. Here are the pictures:

Capture 2019-12-11 17_12_16.png

Capture 2019-12-11 17_12_04.png


The green wire on the right connects to the input of the decimal counter, and the yellow wire on the right to the reset on the decimal counter. the 7 segment displays on the left are connected to the output of the decimal counter. Both the 0-9 and 10-90 machine work simultaneously. but on the second machine, there is a 1-second delay before the pulses are sent to the decimal counter because if the top level dummy loop is deactivated while the dummy pulse generator(s) started sending pulses I found that 1 pulse was missing per dummy.

Here is a youtube video of the machine in action

Let me know what you think. I am still going through all the posts here. For the future I want to make my pi approximator and I am really interested to see what other algorithms can be done in terraria and with what speed and precision etc.
 

Attachments

putianyi888

Terrarian
99.png

This is what I made a long time ago. Basically you can ignore the shifter at the bottom and only focuse on the randomizer at the top which is combined of 5 logic gates.
Once you activate the switch, the green wire has equal opportunity to be activated for 0 to 5 times. This device was designed for dice which has 6 statuses. You can extend this device to 10 (9 gates actually) and connect it to a decimal counter with display.

The above randomizer can generate a permutation, while the below one can generate a combination. video showcase
134.png
135.png

Ignore the below resetting part. Once you activate the switch, random 4 of the 8 logic gates activate. You can extend this device to randomly choose n from m.

These schematics are included in a Terraria wiring documentation written by me. The documentation is currently in Chinese only and also in progress, but I hope some schematics can be useful to you.

BTW, there are bunch of other methods better than monte-carlo to approximate pi. Some of them are both more accurate and simpler to achieve.
 
Last edited:
Top Bottom