Computer Science Canada

Login In Turing

Author:  namansetia [ Sun Dec 07, 2014 1:51 pm ]
Post subject:  Login In Turing

What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>


What is the problem you are having?
<Answer Here> In turing, how do I create a login for the user?


Describe what you have tried to solve this problem
<Answer Here>


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>

Turing:


<Add your code here>



Please specify what version of Turing you are using
<Answer Here>

Author:  asdfasdf123 [ Wed Dec 17, 2014 12:08 pm ]
Post subject:  Re: Login In Turing

Here's how I would do it:
Turing:

var username1, username2, password1, password2 : string
% Creating account
put "Sign up"
put "Username: "..
get username1
put "Password: "..
get password1
put ""
% Logging in
put "Log in"
put "Username: "..
get username2
put "Password: "..
get password2
if username2 = username1 and password2 = password1 then
put "You have logged in"
else
put "Username and/or password incorrect."
end if



: