mirror of
https://github.com/FranP-code/Hangman-game-with-React.git
synced 2025-10-13 00:42:32 +00:00
Register logic actualizated
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
const MakeRandomString = (length) => {
|
||||
|
||||
let result = '';
|
||||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
const charactersLength = characters.length;
|
||||
|
||||
for ( var i = 0; i < length; i++ ) {
|
||||
|
||||
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
||||
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export default MakeRandomString
|
||||
Reference in New Issue
Block a user