How do I input excerpts of a .txt file into a program in Java? -
i'm writing programme calculate probability of getting 'bingo' on rack in scrabble rack. i'm @ primitive stages , haven't got downwards writing code yet. however, have started working on logic.
the issue i'm having this. have a.txt file serves dictionary justice words against in scrabble. called csw-12 dictionary , direct download .txt using can found here.
typically, programme called zyzzyva used access words. link download programme can found here.
okay, out of .txt, need input 7 letter words. , words, without meaning. mean taking word , skipping line when nail space guess.
i relatively new java , know little it. have no thought how input info external file .txt much less how input excerpts it.
any help appreciated. , i'd much rather teach me how said task me.
you can search on here how read file; there many questions on in java, relevant classes filereader
, bufferedreader
.
you can find first space on line indexof(' ')
and, if @ offset 7 (the 8th character), first 7 characters substring(0, 7)
. since words sorted in ascending length, first space @ offset 8 can stop reading, rather going end of file.
java input game-theory
No comments:
Post a Comment