java - show a list of word and definition using hashmap -


i trying create simple game with list of words using hashmap. want is. want show user word list in scrambling way. example word hello "loeh". user have enter answers, , if answer right user point. can tell how able scramble key in map list display user;

this code have far;

public class game extends applet {  /*  * (non-javadoc)  *   * @see java.applet.applet#init()  */  // create list words answers. probbaly map list   map<string, string> words =  new hashmap<string, string>();      // add words ,  definition  list      words.put("hi", " form salutation"); 

here concept go with.

for each letter in word     listofletters.add(letter)  while(listofletters.notempty())     scrambledword += listofletters.pop(randomnum(0,listofletters.size))  print scambledword 

pop here both returning letter , removing list. if code psuedo code out java , have errors post edit , ill debug.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -