What you’ll learn:

Basic Minecraft lets you use Redstone to create cool and complex circuits. With the addition of a computer, we can make things more interesting. Using an Advanced Computer, we’ll create a door lock that asks for a password

-- Password protected door lock
-- Use a computer to password protect your base!
-- Jim Christian
-- Coding in Minecraft

-- start the main loop
while true do
	-- clear the screen
	-- set the position of the cursor
	term.setCursorPos(1, 1)
	-- print a prompt to the screen and mask the input with an asterisk
	print("Input the password.")
local input = read("*")
	-- check the input variable vs the actual password
	if input == "dinnerbone" then
		-- let the player know that they're correct
		-- output a Redstone signal to the right of the computer
		redstone.setOutput("right", true)
		-- wait five seconds
		-- end Redstone signal output
		redstone.setOutput("right", false)
		-- end the loop
	-- check if the password entered is incorrect
	elseif input ~= "dinnerbone" then
		-- clear the terminal
		--set the cursor position
		term.setCursorPosition(1, 1)
		-- display an error message
		-- break the loop and end the program
	-- end the if statement	
-- end the while loop