Ask coding questions

← Back to all posts
How to separate a string with spaces and randomly pick a combonation of letters to make a word?
h
JULIODIAZ1 (46)

Im making a Genetic Algorithm which is a way to train AI. It is based off of natural selection(survival of the fittest) and im doing a thing where it learns to guess a string so thats why i need this.

heres the characters

var characters = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM " 

edit: i also need it to include the character "space" or better known as " "

Comments
hotnewtop
RYANTADIPARTHI (6006)

per how any characters, do you want spaces? Do you want a space for every character?

JULIODIAZ1 (46)

after random, or can you not do that? if not just after 5 characters. @RYANTADIPARTHI