• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Need to ignore words after First Word

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
reply
    Bookmark Topic Watch Topic
  • New Topic