The three lines immediately following are only executed if the password is correct. The first line we add, if input = "password" then checks whether or not the input variable contains the string "password". Where "password" is the password needed to open the door. In the read call on the third line ( read("*")), the asterisk character will be used to replace each letter typed by the user, so that the password stays hidden. So for example, if I typed "qwerty", it would be assigning "qwerty" to the input variable. The fifth line assigns whatever the user types to the variable 'input'. This ensures that each time the program loops, the text appears in the same place. The second and third lines clear the screen of whatever may have been on it, and then set the cursor position to the top-left corner of the screen. The first line opens a loop that will continue running forever, or until we explicitly exit it with the 'break' keyword. Once you access the startup file, enter in these five lines. ![]() This will make it so the program will be executed when the computer boots. Once you're done with the basics, open the computer and edit the "startup" file (type in edit startup). ![]() Like this:Īlternatively, you can put the computer adjacent to the iron door without using redstone. 3 Stop people from terminating your lockĪ password protected door is actually pretty easy, if you break it into steps.įirst, you need to craft a computer, and connect the back to an iron door with redstone.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |