You did not write which language

here you have an example how to read a file line by line in java:
http://answers.yahoo.com/question/index?qid=20091102215123AAmOPmGafter you read all the words into the collection (Arraylist add) you can use Collection's shuffle method to shuffle the arraylist and then just take the first element of this shuffled arraylist: arraylist.get(0)
Also here is an algorithm to shuffle word in java:
ArrayList<Character> chars = new ArrayList<Character>(word.length());
for ( char c : word.toCharArray() ) {
chars.add(c);
}
Collections.shuffle(chars);
char[] shuffled = new char[chars.size()];
for ( int i = 0; i < shuffled.length; i++ ) {
shuffled[i] = chars.get(i);
}
String shuffledWord = new String(shuffled);
here you have an example how to read line from console (console = user input)
http://alvinalexander.com/java/edu/pj/pj010005good luck :-)
This post was edited by Ironfister on Oct 1 2013 09:46am