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
Post a Comment