MightyPirates / TIS-3D

TIS-100 inspired low-tech computing in Minecraft.
https://www.curseforge.com/minecraft/mc-mods/tis-3d
Other
108 stars 35 forks source link

Dont know how to make a password for redstone modular and then make the redstone module activate redstone #98

Closed WhiteWolf0952 closed 3 years ago

WhiteWolf0952 commented 4 years ago

Please help me it would be very thankful

Szasdragon commented 3 years ago

With one execution module, you can use two loops, to represent the two state of the security system (closed, opened).

In the start (closed) state (not provided with the correct password) the machine send a signal to the redstone module which represent the "(keep) close" redstone signal. It query its input to decide, is somebody input the correct password? There is a conditional jump (mind the machine had to remember the correct answer and the current input somehow).

In the second (opened) state the machine send a signal to the redstone module which represent the "(keep) open" redstone signal. Mind if you want a reusable lock machine, it has to have some reset input, to go back in to closed state and lock the door.

This just the core of the machine. Depending on how it gets its inputs, the properties of the password, how to evaluate the player's answer, what type of outputs needed, you have to use more or less modules and program code. I suggest study the finite state machine model of computation and make some truth tables for your machine. It helps to break down your problem in to manageable chunks, to write a solution.