Could you help me to write very simple script to auto generate user name ?
From any letters. Min 6 - Max 10.
Like: "jgFJFJ" "KGHGyvk" etc.
Firstly a random username is bad users wont remeber it
Secondly the forum rules say no students asking us to work for them and this seems a little like homework so i will give you a run though how to do it then you can google the exact how to's
username = empty string
chars = array of charators
Make a loop for how meany chars in length you want the username
inside loop set random to a random number using the lenght of chars -1 as the max and 0 as the low then then add the char by using the random number as the key for your chars array
return the username string
1) put all the letters and characters for the username in a string
2) generate a random number between 6-10
3) then generate a random number between 0 and the length-1 of the string in 1)
4) get the character (
5) repeat steps 3-4 for the number of times of the random number in 2), appending the new character to the previous ones.
Thank you :)
I will review it and try to implement :)
I will post my results.
What software is the best to write and test JS ? With debugger etc...
no problem :)
If you are just starting out then any text editor will be ok and probably try Notepad++. Or if you would like to jump straight into the deep end, then maybe have a look at an IDE like Netbeans which has a lot more bells and whistles..
For debuging js, I suppose the easiest tool would be Firebug in the Firefox browser or the web developer tools in any of the other major browsers.
If you're not comfortable using a debugger, you can always use alert()s in your js code to check values of variables etc.
If you need more help, post back with your code and we can try to help you get it working.
|All times are GMT +1. The time now is 08:21 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.