This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Need to ignore words after First Word

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone !

I am stuck in my project.
It seems easy but i am newbie and i can not handle it.

So, here is my question ;

My teacher give me a dictionary list like

ABRI a bomb shelter [n -S]
ABUT to touch along a border [v ABUTTED, ABUTTING, ABUTS]
ABYE to {aby=v} [v ABOUGHT, ABYING, ABYES]
ABYS <aby=v> [v]
ACED <ace=v> [v]
ACES <ace=v> [v]


i should skip the explanations of words. I should only get the first word and add it into an array.

secondly i should random a word and write hangman game but it is okay. My problem is about getting words from the list. Could anyone help me ?

Thanks to all !
 
lowercase baba
Posts: 12754
51
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first steps always involve turning off your computer. Stop thinking about writing a program. Start thinking about how you would tell a child to do this task.

Assume all the data is written on a piece of paper.

How would you tell the child to identify the "first word"?
 
James Hannigan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably i will give him a scissor and show where he should cut the paper or , oh, i am not good at communicate with childs i dont know man.
or i can let him know he should not take after first whitespace ?
 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

god likeme wrote:i can let him know he should not take after first whitespace ?


That sounds good. So now all you need to do is work out how to do that in Java.
 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll give you another clue since you seem to be struggling. Look at the api docs for the String class and read about the indexOf() method. Does that give you any ideas on how you could find that space?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!