Author |
Message |
KONjbnj
|
Posted: Wed Apr 27, 2005 8:12 am Post subject: Need help with password |
|
|
I need to create a program that when i need to get something from the user it puts it in asterisks like a password (like when you log into hotmail)
Thanks
KonjBnj |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
mksound
![](http://i2.photobucket.com/albums/y20/kmerhai/crown1tk.jpg)
|
Posted: Wed Apr 27, 2005 8:41 am Post subject: re |
|
|
hmm............... figure it out..... |
|
|
|
|
![](images/spacer.gif) |
jamonathin
![](http://compsci.ca/v3/uploads/user_avatars/57683465145f851a43dd9a.gif)
|
Posted: Wed Apr 27, 2005 9:01 am Post subject: (No subject) |
|
|
You need to var something : string := "" (equal to nothing)
then you need to var something_else: string (1)
Now you need to use getch, and whenever the user inputs a letter, clear last screen, and add the input to something. Then use a for loop that uses the length of something, and have it display "*" or whatever for how many times it goes through that for loop. And just have the program exit when enter is elsected or something.
** The program must be looped **
mksound wrote: hmm............... figure it out.....
Those are words spoken of someone who doesn't know the answer himself. ![Razz Razz](http://compsci.ca/v3/images/smiles/icon_razz.gif) |
|
|
|
|
![](images/spacer.gif) |
KONjbnj
|
Posted: Wed Apr 27, 2005 1:36 pm Post subject: (No subject) |
|
|
Ok that makes sense just that im still a noob at turing and dont know things like getch so can you plz show the source code or part of it
Thanks
KonjBnj |
|
|
|
|
![](images/spacer.gif) |
jamonathin
![](http://compsci.ca/v3/uploads/user_avatars/57683465145f851a43dd9a.gif)
|
Posted: Wed Apr 27, 2005 1:40 pm Post subject: (No subject) |
|
|
Here's a tip.
Look up getch to see what type of variable you need, and remember that thing stores hold.
*** Hit F10 *** |
|
|
|
|
![](images/spacer.gif) |
KONjbnj
|
Posted: Wed Apr 27, 2005 1:45 pm Post subject: (No subject) |
|
|
I still dont get it that much plz help |
|
|
|
|
![](images/spacer.gif) |
jamonathin
![](http://compsci.ca/v3/uploads/user_avatars/57683465145f851a43dd9a.gif)
|
Posted: Wed Apr 27, 2005 1:51 pm Post subject: (No subject) |
|
|
You're not gettin any more source code after this. Look up the vars and whatnot, and when you go to replace the letters, use a for loop like this.
code: | for i : 1 .. length (thing) |
Reason you want to display however many letters there are in the password with *'s. The reason I'm not giving you any mre source code, is because there isn't much left, and this sounds like an assignment for school. |
|
|
|
|
![](images/spacer.gif) |
Bacchus
![](http://img104.exs.cx/img104/9206/ravenmoon12ns.jpg)
|
Posted: Wed Apr 27, 2005 6:36 pm Post subject: (No subject) |
|
|
Turing: | var letter: string(1) %this declares the variable to hold the tmp letter
var password: string: ="" %setting a blank var to nothing to hold pass
loop
getch(letter ) %this will get the letter you want
password+=letter %after done, this will hold what they inputted
put "*".. %puts the asterixs for each things they type
end loop | i didnt do all, liek you would want a way to exit the loop, check ord in f10 and figure out ![Razz Razz](http://compsci.ca/v3/images/smiles/icon_razz.gif) |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
McKenzie
![](http://www.wizards.com/global/images/swtcg_article_27_pic3_en.gif)
|
Posted: Wed Apr 27, 2005 6:50 pm Post subject: (No subject) |
|
|
Make sure you set your screen to noecho or you will defeat the purpose:
|
|
|
|
|
![](images/spacer.gif) |
mike200015
|
Posted: Wed Apr 27, 2005 8:45 pm Post subject: (No subject) |
|
|
wat does noecho do?? |
|
|
|
|
![](images/spacer.gif) |
Bacchus
![](http://img104.exs.cx/img104/9206/ravenmoon12ns.jpg)
|
Posted: Wed Apr 27, 2005 8:55 pm Post subject: (No subject) |
|
|
if u use getch or get then it wont put the letters on the screen when you press the key |
|
|
|
|
![](images/spacer.gif) |
mike200015
|
Posted: Wed Apr 27, 2005 11:20 pm Post subject: (No subject) |
|
|
with getch, it doesn't put the letters on the screen anyway |
|
|
|
|
![](images/spacer.gif) |
|